🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #68

how to minimize JInternalFrames

#68
From: Maria
Date: Tue, 12 Nov 2002 13:32
42 lines
2529 bytes
HI!
I would really appreciate it if somebody could help me.

In my Application there is a JFrame(MainFrame) with a MenuBar and a
ToolBar. Through this I can open a JInternalFrame. What I want is to
minimize my internalFrame, but still have the opportunity to do some
things at the Menu/ToolBar. I have some problems to set/get the focus,
with the code above I
get a Nullpointer-Exception.
the method minimize() should only minimize the internalFrame which has
the focus.
the method addchild() adds some internalFrames.

Thanx in advance!!!!


 private void minimize()
  {
    int f;
//the number of internalFrames, put in an array 
    FrameMain[] frame = new FrameMain[this.getFrames().length]; 
for(f = 0; f < this.getFrames().length; f++)
    {
     if(frame[f].getFocusOwner() != null)
    {
          switch(getState())
         {
           case javax.swing.JFrame.NORMAL :
frame[f].setState(javax.swing.JFrame.ICONIFIED);
           case javax.swing.JFrame.ICONIFIED :
frame[f].setState(javax.swing.JFrame.ICONIFIED);
           default: System.out.println("unknown state:"+getState());
         }
    

public void addChild(JInternalFrame child, int frameLocationX, int
frameLocationY, Dimension frameSize){
    jPanelMain2.add(child);
    child.setLocation(frameLocationX, frameLocationY);
    child.setSize(frameSize.width, frameSize.height);
    child.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
    child.setVisible(true);
Technical Details
Message-ID: <7c7c12d0.0211120532.27cf8c28@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,ad6e4b8c8f3a2d21,start
X-Google-Attributes: gid111d45,public
X-Google-Thread: f74b3,ad6e4b8c8f3a2d21,start
X-Google-Attributes: gidf74b3,public
X-Google-Thread: f7ed6,ad6e4b8c8f3a2d21,start
X-Google-Attributes: gidf7ed6,public
X-Google-ArrivalTime: 2002-11-12 05:32:45 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: manda_Rin@gmx.net (Maria)
Newsgroups: borland.public.jbuilder.java.language,borland.public.jbuilder.java.swing,borland.public.jbuilder.enterprise
Subject: how to minimize JInternalFrames
Date: 12 Nov 2002 05:32:45 -0800
Organization: http://groups.google.com/
Lines: 42
Message-ID: <7c7c12d0.0211120532.27cf8c28@posting.google.com>
NNTP-Posting-Host: 193.158.111.68
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1037107965 28090 127.0.0.1 (12 Nov 2002 13:32:45 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 12 Nov 2002 13:32:45 GMT