lotharious
MIS
I am trying to get an input dialog that puts labels on the left, input boxes on the right and the ok/cancel on the bottom. Ive gone over almost all ideas Ive ad that I thought would work.
labels[] are JLabel and textfields[] are JTextfield
This is what I thought would work, or the last thing I though would work.
Any help or advice would be appreciated.
labels[] are JLabel and textfields[] are JTextfield
This is what I thought would work, or the last thing I though would work.
Any help or advice would be appreciated.
Code:
final Box outmostBox = Box.createHorizontalBox();
getContentPane().add(outmostBox, BorderLayout.WEST);
outmostBox.add(Box.createHorizontalStrut(PADDING));
JSplitPane spanel = new JSplitPane();
spanel.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
spanel.setContinuousLayout(true);
JPanel lpanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
JPanel rpanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
for(int i = 0;i < NUM_ATTRIBS;++i) {
lpanel.add(labels[i]);
rpanel.add(textfields[i]);
}
spanel.add(lpanel,JSplitPane.LEFT);
spanel.add(rpanel,JSplitPane.RIGHT);
outmostBox.add(spanel);