Skip to main content


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 11:27 Go to next message
Eclipse UserFriend
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 19:04 Go to previous message
Philippe Ombredanne is currently offline Philippe OmbredanneFriend
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 19:04 Go to previous message
Philippe Ombredanne is currently offline Philippe OmbredanneFriend
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: Sat Sep 21 18:15:58 GMT 2024

Powered by FUDForum. Page generated in 0.03715 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top