First I would like to thank those that were able to point out my stupid
mistake of forgetting to put a setVisible in my code in order to see my
internal frames.
Next I have a couple more questions. I am new to Swing programming and was
wondering if someone could point me in the right direction for doing the
following:
- I have my JFrame in which I add a JDesktopPane, and in that I have a
couple of JInternalFrames that I use. In the main winow of the app (the
content pane of the JFrame if I am correct) I would like to put a tiled
image to serve as the background. I thought I was doing it correctly, but
nothing shows up. I created an ImagePanel class that extends JPanel and
does the following in the constructor:
image = Toolkit.getDefaultToolkit().getImage("test.gif");
MediaTracker tracker = new MediaTracker(this);
tracker.addImage(image,0);
try { tracker.waitForID(0); }
catch (InterruptedException exception) {}
and then the paintComponent method draws the image in the top left corner
and then copies it the rest of the panel.
I then created a panel of the ImagePanel type and added it to the content
pane of JFrame by doing the following:
ImagePanel imagePanel = new ImagePanel();
imagePanel.setVisible(true);
Container content = getContentPane();
content.add(imagePanel);
I then go on to add the desktop and the internal frames. Is there a flaw in
my understanding on how to do this?
- I would also like to find some reference that can point me in the right
direction to do the following: My first internal frame that I add to the
desktop contains a JTable which I would like to populate from a database
(mySQL server). When I double click on one of the rows or single click on a
row and then click Open button, I would like to open another internal frame
with fields populated from the recordset for which row I selected.
Any help would be appreciated.
Thanks in advance.
Ken
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing