Re: Changing JFrame components at runtime



lego_lax wrote:
In my JFrame I have a JPanel's extension class with a 2-dimensional
array of 3X3 JLabels.
This array is, of course, created in initComponents()

Which IDE are you (mis)using?

...of MyPanel

RenderPanel, ContentArea or LabelArrayPanel are
all better names for this than MyPanel - mostly
because it makes it sound as if it were written by
a 2 yr old in the 'I, me, mine!' phase.

...class.
I've put a menu item in which user can change the dimension of JLabels'
grid.
If, e.g., the user chooses 4 then MyPanel should change that grid to a
4x4 array of JLabels.
How can I do that?

CardLayout, JTabbedPane or removing and re-adding the
components might all work in particular situations.

...Can I invoke again initComponents() methods of
MyPanel and JFrame?

I don't know. What does your IDE say? It sounds
like it is writing the code.

Andrew T.

.



Relevant Pages

  • Changing JFrame components at runtime
    ... This array is, of course, created in initComponents() of MyPanel class. ... I've put a menu item in which user can change the dimension of JLabels' ...
    (comp.lang.java.gui)
  • Re: Poor performance from file system
    ... moving several GB of music files from another machine or ... One consists of two IDE hard ... The other array consists of 4 SCSI drives, ...
    (comp.os.linux.misc)
  • Re: Poor performance from file system
    ... moving several GB of music files from another machine or ... One consists of two IDE hard ... The other array consists of 4 SCSI drives, ...
    (comp.os.linux.hardware)
  • Re: p5gd2premium ide detection problems
    ... My cd rom and dvd burner are on the ide ... > I have three sata hard drives on the raid sata ports. ... > I do have power to the two ide drives. ... Disks in array ...
    (alt.comp.periphs.mainboard.asus)
  • Is Array Empty
    ... api call using CopyMemory (in my test blows up ide instantly) ... ' Dim lAddressArrayDescriptor As Long ... IsArrayEmpty = True ... 'trap error on uninitialized array ...
    (microsoft.public.vb.general.discussion)