Hello,
I understand your concern with the Free Design, because it is done with a single click. Look at the code below
Code:
Public class NewJFrame1 extends javax.swing.JFrame {
Public NewJFrame1() {
great("NewJFrame1");
initComponents();
}
/ / <editor-fold Defaultstate="collapsed" desc="Generated code">
private void initComponents() {
jbut1= new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jbut1.setText("jbut1");
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, Layout.createSequentialGroup()
.addContainerGap(317, Short.MAX_VALUE)
.add(jbut1)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(org.jdesktop.layout.GroupLayout.TRAILING, Layout.createSequentialGroup()
.addContainerGap(266, Short.MAX_VALUE)
.add(jbut1)
.addContainerGap())
);
java.awt.Size scrsize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setBounds((scrsize.width-408)/2, (scrsize.height-334)/2, 408, 334);
}/ / </ Editor-fold>
Public static void hand(Final String[] args) {
Runnable guitest = new Runnable() {
Public void run() {
new NewJFrame1().setVisible(true);
}
};
/ / GUI must start on EventDispatchThread:
SwingUtilities.invokeLater(guitest);
}
/ / Variables declaration - do not modify
private javax.swing.JButton jbut1;
/ / End of variables declaration
}
Bookmarks