Solved

Jdialog / JFrame Confusion

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

937 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

15 Experts available now in Live!

Get 1:1 Help Now