-2

I try more script to set background in JInternalFrame but no one successfull. Can anybody help me?

mKorbel
  • 109,525
  • 20
  • 134
  • 319

1 Answers1

3

Basically, this is the same concept as setting the background image for a JFrame

You Could

Create JLabel, set the image as the labels icon and set the label as the JInternalFrame's content pane, making sure you set the layout manager for the label (or content pane after you changed it)

You Could

Create a custom panel, that paints the image via the panels paintComponent method

This is good if you want to make the background resizable as the window is resized

Take a look at Java: maintaining aspect ratio of JPanel background image an example

You would then, simply set this as the frame's content pane

Community
  • 1
  • 1
MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
  • Can you share the example script? – user3124648 Dec 21 '13 at 05:25
  • Did you 1- check the linked example; 2- check the [JavaDocs](http://docs.oracle.com/javase/7/docs/api/javax/swing/JInternalFrame.html); 3- Check the [tutorials](http://docs.oracle.com/javase/tutorial/uiswing/components/rootpane.html); 4- Search for examples of setting the background image of a JFrame? – MadProgrammer Dec 21 '13 at 05:40