I have a JDesktopPane that contains a series of JInternalFrames. These
frames contain various tables of data. I wish to allow the user to
validate the data in a table before they save it to file. I am
currently placing the results of the validation in another frame and
displaying it on the JDesktopPane.
However I would prefer to display the results in a separate area to
one side of the desktop. To do this it would seem that I should create
a panel (with a layout manager) and add my desktop to that. Then when
the results of a validation request are ready, add a component holding
those to the side of the desktop. Unfortunately I cannot get this to
work!
A rough outline of the code I have tried:
JPanel panel = new JPanel(new BorderLayout()); // for instance
.....
panel.add(desktop, BorderLayout.CENTER);
....
JTextPane result = table.validateData();
JScrollPane checkResult = new JScrollPane(result);
panel.add(checkResult, BorderLayout.EAST);
Unfortunately nothing appears, neither the desktop nor the results.
Bob
Bob Wightman - 12 Jan 2004 08:44 GMT
> I have a JDesktopPane that contains a series of JInternalFrames. These
> frames contain various tables of data. I wish to allow the user to
[quoted text clipped - 21 lines]
>
> Unfortunately nothing appears, neither the desktop nor the results.
OK, I found what I was doing wrong about an hour after posting: I
needed a call to pack() the layout.
On to the next stage :-)
Bob