• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JInternalFrames, fault in code

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

I recently posted a question about getting a JInternalFrame so you can
see through it, but it doesn't seem to work when I apply to a card layout.

My code is something like this:


Then I add the 'jdtp' to the JFrames ContentPane.
The JInternalFrame displays properly, but the JPanels I added to 'cards'
won't display, and the screen is blue.

I don't see why it doesn't work, can anyone help.
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems only JInternalFrames can be added to JDesktopPanes which explains why only the JIntenalFrame shows.

I guess I'll have to create a JPanel 'cards' with CardLayout,
which I can add 2 objects that extend JDesktopPane.

Thats probably best.
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I can't get this to work, can anyone help.

Basically I need a JPanel(CardLayout) with a JInternalFrame lying on top,

OR

A JPanel(CardLayout) where two JDesktopPanes(each having their own JInternalFrame) are added.

I tried both approaches, but I can't get it to work, is there any way to do this?

Thanks
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
works OK like this

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thats great thanks!

I fiddled with it, and put an image in there too.
I realise why I was couldn't get the colour to work right
inside the JInternalFrames,
I assumed new Colour(a,b,c,d) had the alpha component first,
but alpha is last, which explains my odd results.

Thanks again.
 
reply
    Bookmark Topic Watch Topic
  • New Topic