auto generated code [message #141332] |
Sat, 29 September 2007 11:27 |
Eclipse User |
|
|
|
Originally posted by: christer.borgqvist10.bredband.net
I`m using Eclipse SDK 3.3.1 and Visual Editor 1.3.0.
Her`s some code when create a new VisualClass
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.GridBagLayout;
import javax.swing.BorderFactory;
import javax.swing.border.BevelBorder;
public class SwingFrame extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
/**
* This is the default constructor
*/
public SwingFrame() {
super();
initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(300, 200);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
}
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(new GridBagLayout());
jContentPane.setBorder(BorderFactory.createBevelBorder(Bevel Border.RAISED));
}
return jContentPane;
}
} // @jve:decl-index=0:visual-constraint="322,31"
After that i added a JLabel to the frame it`s looks like this
/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
GridBagConstraints gridBagConstraints = ;
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
jLabel = new JLabel();
jLabel.setText("JLabel");
jContentPane = new JPanel();
jContentPane.setLayout(new GridBagLayout());
jContentPane.setBorder(BorderFactory.createBevelBorder(Bevel Border.RAISED));
jContentPane.add(jLabel, gridBagConstraints);
}
return jContentPane;
}
} // @jve:decl-index=0:visual-constraint="322,31"
appreciate any help
Christer
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03715 seconds