how to change the name of a generated constraint bean [message #612093] |
Mon, 13 February 2006 16:17 |
Markus Messages: 52 Registered: July 2009 |
Member |
|
|
Hi again!
I'm adding a new layout to VE. My problem is the following:
I want to let VE create a constraint bean for each object in the getJPanel
method (quite similar to what the GridBagLayout does).
First this constraint object was a common java.awt.Rectangle, which worked
pretty fine.
This code was created:
private JPanel getJPanel() {
if (jPanel == null) {
Rectangle rectangle = new Rectangle();
rectangle.height = 33;
rectangle.x = 101;
rectangle.y = 203;
rectangle.width = 73;
jPanel = new JPanel();
jPanel.setLayout(new MyLayout());
jPanel.add(getJButton(), rectangle);
}
return thirdPanel;
}
The next step was to write a new constraint class, let's call it
MyConstraints.
This ended in this code:
private JPanel getJPanel() {
if (jPanel == null) {
MyConstraints MyConstraints = new MyConstraints();
MyConstraints.setLeftEdge(101);
MyConstraints.setOtherThings;
.
.
.
jPanel = new JPanel();
jPanel.setLayout(new MyLayout());
jPanel.add(getJButton4(), MyConstraints);
}
return jPanel;
}
As you can see the created constraint bean is called MyConstraints,
starting with an upper-case character.
How can I change the (default) name of such constraints?
It would be sufficient to call it myConstraints, starting with a small
letter.
In the first case with the java.awt.Rectangle, the rectangle was created
automatically with a lower-case character. Also the GridBagLayout creates
gridBagConstraints, starting with a small letter.
Regards,
Markus
|
|
|
Powered by
FUDForum. Page generated in 0.03078 seconds