Solved

Jdialog / JFrame Confusion

Posted on 2004-08-26
8
1,022 Views
Last Modified: 2008-01-09
I'm wanting to create a fairly simple UI which will present forms to the user which will allow them to view and alter data held in a database. It seems like it should be simple stuff, but I've got horribly confused. I started out using JFrame's for each of my forms - these had all the right window decoration, appeared on the Windows Taskbar ( which I want to happen ) but I couldn't make them modal. So I switched to JDialog, which I can make modal, but don't appear in the taskbar and don;t have the right window decoration ( can't minimze etc ... ) Then I read the API docs which said that creating the JDialog passig in a Frame as parent would give me what I need - I've tried about a million different combinations and I can't get it to work. Can someone explain to me what the relationship is between this two classes and how they can be used together to achieve what I'm after? I can't believe that this is as hard as I'm making out!
0
Comment
Question by:howesd
8 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11907798
onlt dialogs have a modal property, but they don't appear on the task bar.
why do u want a modal frame?
0
 
LVL 15

Expert Comment

by:Javatm
ID: 11908299
> Can someone explain to me what the relationship is between this two classes and how they can be used together to achieve what I'm after?

The only GUI that you can use for what you need is what your using now. JDialog is a modal frame but does not appear on the taskbar.
Thats the way it was made you if you still want to have a modal frame JDialog is the answer.

Hope that helps . . .
Javatm
0
 
LVL 1

Author Comment

by:howesd
ID: 11910592
Objects - it may be that I'm being a little naieve in my gui design, but basically my design was to have a form ( frame / dialog / whatever ) which presents options to the user ( search / add new / run defined queries / maintain standing data etc ) - When they choose an option, a new form is presented - I was intending to keep these forms modal so that I don't have to worry about potential conflicts between the various gui items - if they're altering standing data in one window which directly influence a client viewed in a different window I'd have to be able the handle the circumstance - making the forms modal removes that difficulty

When you use the constructor for JDialog that takes a frame as a parameter, what happens? I don;'t understand what it's supposed to achieve?
0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 11918408
the dialog will always stay on top of its owner
0
 
LVL 18

Expert Comment

by:armoghan
ID: 11920070
I would suggest use a JFrame as the first window with menus etc and on there clicks open JDialogs as models, which have JFrame reference as owner/parent. If you need to open more windows on top of JDialog.. They will also be JDialogs..

This is a simple design for your application

Hope that helps
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question