drawing an image
Who can help me!
I have make an applet with pictures. Now I will make it so that when I clicked on a picture it must be bigger in a new frame.
What I do the picture comes not in the new frame.
I have make under the mouseClicked the rules,
JFrame f = new JFrame();
f.setBounds(0, 0, 300, 400);
f.setTitle("Frame 2");
But what do I write to come a picture into the f.?
Help, help!
[433 byte] By [
harriea] at [2007-10-2 21:10:08]

Instead of using a JFrame, try using a JDialog. Something like this will work, though you will most likely want to create your own dialog that extends JDialog:
// create the dialog
JDialog d = new JDialog();
// set the layout for the dialog content pane
d.getContentPane().setLayout(new BorderLayout());
// create the image to be displayed from a relative directory to this class
Icon image = new ImageIcon(MyApplication.class.getResource("images/myPicture.gif"));
// create a label (you need a component to add)
JLabel label = new JLabel();
// set the image onto the label
label.setIcon(image);
// add the label to the CENTER of the content pane in the dialog
d.getContentPane().add(label, BorderLayout.CENTER);
// pack and show
d.pack();
d.setVisible(true);
gil_ea at 2007-7-13 23:56:06 >

Gil_e, I have tried it, but its works not. What I do, how I do it.Help me and can you give the hole code so I can see that its works?My English is not so good, but I try.