I am very new to
Java, though have about 10 years with VB. What I would like to know is there a process of shortcut that would allow not repeating object / method repition? eg
public class TryFlowLayout {
static JFrame aWindow = new JFrame("Flow Layout Window by DOCO");
public static void main (
String[] args) {
Toolkit theKit = aWindow.getToolkit();
Dimension wndSize = theKit.getScreenSize();
aWindow.setBounds(wndSize.width / 4, wndSize.height / 4,
600, wndSize.height / 2);
aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
FlowLayout flow = new FlowLayout();
Container content = aWindow.getContentPane();
content.setLayout(flow);
for (int i = 0; i <= 6; i++)
content.add(new JButton("Press " + i));
aWindow.setVisible(true);
}
}
Replace the repition of aWindow for instance:
{...
With aWindow
.setBounds(...);
.getContentPane(...);
.setVisible(...);
End With
...}
Sure would be handy if there were
TIA
doco