• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jpanel and internal frame

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Im alittle new to GUI programming. Is it possible to add a pnel to an internal frame>?

I have created a panel in a class of its own called myPanel. If it is possible to add the panel to the internal frame, how would I do this??

thanks in advance

public class GUI extends JFrame {
public Integer LAYOUT_FRAME_LAYER = new Integer(1);

public GUI() {
super("Music Theory application");
setSize(500, 460);
JDesktopPane desktop = new JDesktopPane();
getContentPane().add(desktop);

JInternalFrame fr1 =
new JInternalFrame("Java Piano",true,true);
fr1.setBounds(10,10,150,150);
Container c = fr1.getContentPane();
c.setLayout(new FlowLayout());


//add panel here??


desktop.add(fr1,0);
fr1.show();


}
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Adding panel to internal frame is possible. its just like adding panel to frame.



All The Best
 
Could you hold this kitten for a sec? I need to adjust this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic