Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » auto generated code
auto generated code [message #141332] Sat, 29 September 2007 07:27 Go to next message
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
Re: auto generated code [message #141366 is a reply to message #141332] Sat, 29 September 2007 15:04 Go to previous message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
"Christer Borgqvist" <christer.borgqvist10@bredband.net> wrote in message
news:fdlcs5$d83$1@build.eclipse.org...
> 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
This a bug :-)
Could you add it to bugzilla?
Add as much information as possible to reproduce easily .
Thanks!
Re: auto generated code [message #616630 is a reply to message #141332] Sat, 29 September 2007 15:04 Go to previous message
Philippe Ombredanne is currently offline Philippe Ombredanne
Messages: 386
Registered: July 2009
Senior Member
"Christer Borgqvist" <christer.borgqvist10@bredband.net> wrote in message
news:fdlcs5$d83$1@build.eclipse.org...
> 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
This a bug :-)
Could you add it to bugzilla?
Add as much information as possible to reproduce easily .
Thanks!
Previous Topic:VE have only one " Eidtordomain" ?
Next Topic:So happy I cried..... almost
Goto Forum:
  


Current Time: Fri Aug 01 01:47:31 EDT 2014

Powered by FUDForum. Page generated in 0.01719 seconds