Article View: borland.public.jbuilder.java.swing
Article #11854Swing 1.1.1 JPanels inside JPanel gives error about awt.Frame
From: John Hines
Date: Tue, 06 Apr 1999 00:00
Date: Tue, 06 Apr 1999 00:00
89 lines
3569 bytes
3569 bytes
I'm using JDK 1.2.1 and Swing 1.1.1 with all (I hope) the patches to make
JB2 work OK.
Both the class below and BaseTabPanel (derived from JPanel) are java beans
created with the bean wizard which are part of a larger project. Everything
compiles and runs (yeah, they don't do much).
However, as soon as I put another JPanel (see line commented out in File 1)
into PhoneNumberPanel and try to compile, I get the message
"Fatal Error: cannot access class javax.swing.JFrame; no source found; must
be compiled, because java.awt.Frame.dispose referenced by class
javax.swing.JFrame has changed"
Even worse, when I delete the newly added panel in the design mode or
comment it out in the source codeto go back to where I previously got a
sucessful compile, I continue to get the same error message. However, I can
reload code for the instant before I added the new panel to PhoneNumberPanel
and get a good compile. Then I can put a panel into PhoneNumberPanel and
get the error message and .....
Any ideas?
John Hines john.hines@sequel.com
==========================File 1================================
package com.sequel.care.gui;
import java.awt.*;
import com.sequel.care.gui.BaseTabPanel;
import javax.swing.border.LineBorder;
import javax.swing.*;
public class PhoneNumberPanel extends BaseTabPanel {
BorderLayout borderLayout1 = new BorderLayout();
private String title = "Phone Number";
//javax.swing.JPanel jPanel1 = new javax.swing.JPanel();
public String getTitle() { return title; }
void jbInit() throws Exception {
this.setLayout(borderLayout1);
this.add(jPanel1, BorderLayout.CENTER);
}
public static void main(String[] args) {
PhoneNumberPanel phoneNumberPanel1 = new PhoneNumberPanel();
phoneNumberPanel1.invokedStandalone = true;
}
public PhoneNumberPanel()
try { jbInit(); } catch (Exception ex)
ex.printStackTrace(); }
}
public PhoneNumberPanel(BaseModel model)
super(model) ; try { jbInit(); } catch (Exception ex)
ex.printStackTrace(); }
}
public void setTitle(String newTitle) { title = newTitle; }
}
==========================File 2================================
package com.sequel.care.gui;
import java.awt.*;
import javax.swing.*;
public class BaseTabPanel extends JPanel
{
BorderLayout borderLayout1 = new BorderLayout();
BaseModel model;
protected boolean invokedStandalone = false;
public BaseTabPanel( ) {
super( ) ; try { jbInit(); }
catch (Exception ex) { ex.printStackTrace(); }
}
public BaseTabPanel( BaseModel model )
{
super( ) ; this.model = model; try { jbInit(); }
catch (Exception ex) { ex.printStackTrace(); }
}
void disableAll() { }
String getTitle() { return "BaseTabPanel"; }
void jbInit() throws Exception { this.setLayout(borderLayout1); }
public static void main(String[] args) {
BaseTabPanel baseTabPanel = new BaseTabPanel();
baseTabPanel.invokedStandalone = true;
}
}
Technical Details
Message-ID:
<7edska$r7b4@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,80591f5f47c994ad,start X-Google-Attributes: gid111d45,public From: "John Hines" <jrhines@onramp.net> Subject: Swing 1.1.1 JPanels inside JPanel gives error about awt.Frame Date: 1999/04/06 Message-ID: <7edska$r7b4@forums.borland.com> X-Deja-AN: 463380082 Organization: Another Netscape Collabra Server User X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: borland.public.jbuilder.java.swing