Article View: borland.public.jbuilder.java.swing
Article #11855Re: Swing 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
97 lines
3862 bytes
3862 bytes
Minor correction made below: I forgot to comment out a line!
John Hines wrote in message <7edska$r7b4@forums.borland.com>...
>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);//Corrected version!
> }
>
> 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:
<7ee08k$r7715@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7edska$r7b4@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,80591f5f47c994ad X-Google-Attributes: gid111d45,public From: "John Hines" <jrhines@onramp.net> Subject: Re: Swing 1.1.1 JPanels inside JPanel gives error about awt.Frame Date: 1999/04/06 Message-ID: <7ee08k$r7715@forums.borland.com> X-Deja-AN: 463401163 References: <7edska$r7b4@forums.borland.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing