Re: Layer JPanels ?




"Tony B" <tagb61@xxxxxxxxxxx> wrote in message news:5SZEh.44632$gM1.39982@xxxxxxxxxxxxxxxxxxxxxxxxx
I'm new to Java and trying to create a simple GUI for the first time.
Is it possible to layer JPanels and setVisible one at a time ?
I'm creating 3 JPanels, and I want to show 1 of the 3 on the main JFrame Content Pane under menu
control.
At the moment if I do this the last one added is always displayed. So I guess the last
contentPane.add(JPanel3) effectively removes the other 2 which makes sense.

I tried putting all 3 JPanels in a single JPanel, and adding this to the content pane. Then I have
the problem they are added in different parts of the content pane. Is there a layout manager that
forces JPanels to display on top of each other ?

Maybe I'm taking the wrong approach. Can I programatically contentPane.add(JPanel1or2o3) instead
?


use a CardLayout()


.



Relevant Pages

  • Layer JPanels ?
    ... I'm new to Java and trying to create a simple GUI for the first time. ... Is it possible to layer JPanels and setVisible one at a time? ... Content Pane under menu control. ... Is there a layout manager that forces JPanels to display ...
    (comp.lang.java.gui)
  • Re: Layer JPanels ?
    ... Is it possible to layer JPanels and setVisible one at a time? ... I'm creating 3 JPanels, and I want to show 1 of the 3 on the main JFrame ... Content Pane under menu control. ... Is there a layout manager that forces JPanels to display ...
    (comp.lang.java.gui)
  • Re: Display a CListCtrl in a CScrollView
    ... > I created a CScrollView (as pane from a CSplitterWnd, ... I want to display a CListCtrl. ... want the list to fill the view pane when things are resized. ... When the control sends you ...
    (microsoft.public.vc.mfc)
  • Re: Layer JPanels ?
    ... I'm creating 3 JPanels, and I want to show 1 of the 3 on the main JFrame ... Content Pane under menu control. ... from Container but implements stacking order differently. ...
    (comp.lang.java.gui)