Solved

Jdialog / JFrame Confusion

Posted on 2004-08-26
8
1,016 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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 …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

707 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now