How can i add multiple images in one panel by java?
I want to divided the panel into multi sections so i can put multi images (one image in each section) by using java language...
hope anyone help me !!!
- 9 years agoBest Answer
Let's say you create a panel
JPanel p1 = new JPanel();
then you do this
p1.setLayout(new GridLayout(3,3,3,3)); //this allows you to add 3 images
just add them using
p1.add("Whatever image variable goes here");Source(s): http://www.javacoder.webs.com
- question askerLv 510 years ago
You can use GridLayout. See this help page:
For example you can do..
I hope this helps.