Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Jdialog / JFrame Confusion

Posted on 2004-08-26
8
Medium Priority
?
1,028 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
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 learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

618 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