🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11363

Re: JDialog Problem

#11363
From: Matthias Bandemer
Date: Thu, 03 Jun 1999 00:00
34 lines
1747 bytes
Hi,

using the getTopLevelAncestor()- Method I get a "constructor not found"
-message, because getTopLevelAncestor() returns a container, not a
frame. 

here ist the constructor:     JDialog modDia = new
JDialog(this.getTopLevelAncestor(),"Modify Data", true);

Is it posible to cast this into a frame or ist there another solution? 

Matt Krevs wrote:
> 
> call getTopLevelAncestor() to get a handle to the frame that you nested
> panels are on.
> 
> Matthias Bandemer <matthias.bandemer@gmx.de> wrote in message
> news:375585BB.1F9323B5@gmx.de...
> > Hi,
> >
> > I have a problem with creating a JDialog. I want to create a modal
> > dialog with titel "Modifying Data". So I use this constructor
> >
> > JDialog(Frame parentFrame, String title, boolean modal)
> >
> > but the parent component of this dialog is a panel. This panel is a
> > child-component of another panel, which is the contentpane of the
> > top-level-frame. Thats why I get an "incompatible types found" message:
> > "found component, frame required". How con I access the top-level-frame
> > from the JDialog-constructor?
> >
> > Thanks for help,
> >
> > Matthias
Technical Details
Message-ID: <37563987.834091D@gmx.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <375585BB.1F9323B5@gmx.de> <7j4fkb$jmc9@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,c40ee21b1dbc2637
X-Google-Attributes: gid111d45,public
From: Matthias Bandemer <matthias.bandemer@gmx.de>
Subject: Re: JDialog Problem
Date: 1999/06/03
Message-ID: <37563987.834091D@gmx.de>
X-Deja-AN: 485186621
Content-Transfer-Encoding: 7bit
References: <375585BB.1F9323B5@gmx.de> <7j4fkb$jmc9@forums.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing