Questions tagged [jdialog]

The main Java Swing class for creating a dialog window.

The main Java Swing class for creating a dialog window.
A Dialog window is an independent subwindow meant to carry temporary notice apart from the main Swing Application Window. Most Dialogs present an error message or warning to a user, but Dialogs can present images, directory trees, or just about anything compatible with the main Swing Application that manages them.

1021 questions
15
votes
1 answer

How to set the JFrame as a parent to the JDialog

I am having trouble to set the frame as a owner to the dialog. Normally when I extend JDialog class for creating a dialog then I use super(frame) to specify the owner of the dialog such that both of them are not disjoint when you press alt+tab. But…
Amarnath
  • 8,736
  • 10
  • 54
  • 81
12
votes
4 answers

Java Swing: positioning dialog on top of existing window

Can someone show simple Java Swing code/web resource that will position the popup dialog center-aligned on top of an existing JFrame window when the JFrame's button clicked?
sivabudh
  • 31,807
  • 63
  • 162
  • 228
11
votes
3 answers

Showing JDialog as sheet not working

I am currently using this code to create a JDialog; package com.kamuara.reposync.window; import java.awt.Dialog; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import…
Thizzer
  • 16,153
  • 28
  • 98
  • 139
11
votes
3 answers

How to create a modal JDialog on top of another modal JDialog

I have a modal settings dialog which is a JDialog. In this settings window I placed some components including a button to yet another modal settings dialog which is also a JDialog. I made them JDialogs because that is the only way I know of to make…
Erik Stens
  • 1,779
  • 6
  • 25
  • 40
11
votes
3 answers

Set location of JDialog relative to JFrame

Is there a way to set a dialog location relative to a JFrame? I would like to center the dialog to the frame that houses my GUI, instead the dialog often appears in the center of the screen rather than within the GUI.
Itchy Nekotorych
  • 882
  • 3
  • 10
  • 24
10
votes
5 answers

Disable JFrame minimize button

I am developing a tool for my laptop. I want to disable minimize button in the JFrame. I have already disabled maximize and close button. Here is the code to disable maximize and close button: JFrame frame = new JFrame(); …
Pankaj Kumar Thapa
  • 131
  • 1
  • 2
  • 6
10
votes
3 answers

Can I set a timer on a Java Swing JDialog box to close after a number of milliseconds

Hi is it possible to create a Java Swing JDialog box (or an alternative Swing object type), that I can use to alert the user of a certain event and then automatically close the dialog after a delay; without the user having to close the dialog?
Dave
  • 267
  • 2
  • 4
  • 12
9
votes
3 answers

action listener to JDialog for clicked button

I have main application where is table with values. Then, I click "Add" button, new CUSTOM (I made it myself) JDialog type popup comes up. There I can input value, make some ticks and click "Confirm". So I need to read that input from dialog, so I…
Paulius Vindzigelskis
  • 2,121
  • 6
  • 29
  • 41
9
votes
1 answer

Can I make ProgressMonitor dialog modal?

is there a way to make the dialog from ProgressMonitor modal? EDIT: The ProgressMonitor class in JAVA API will bring a dialog which is on the top but not Modal. User still has access to the background GUI. I am looking for a Modal dialog to show the…
5YrsLaterDBA
  • 33,370
  • 43
  • 136
  • 210
9
votes
5 answers

Modal JDialog without blocking execution

Is there a way how to use a dialog in Swing which prohibits any gui activity under it but at the same time DOES NOT stop execution on the thread where it was set to visible?
ps-aux
  • 11,627
  • 25
  • 81
  • 128
8
votes
2 answers

Java: How can I disable clicking on a panel while showing dialog?

I want to disable clicking on the background panel or frame while showing a dialogue. And I want the dialogue to appear on top of this panel or frame constantly until it is closed. How can I do this?
Olcay Ertaş
  • 5,987
  • 8
  • 76
  • 112
8
votes
6 answers

Create an inspecting properties window, button driven as a JDialog

What I asked originally didn't clearly state my question/problem, so I will explain it better. I have a JButton that sets a JDialog to visible. The JDialog has a WindowListener that sets it to NOT visible on the windowDeactivated() event, which is…
Brian
  • 81
  • 3
8
votes
7 answers

How to close a modal JDialog when user clicks outside of JDialog?

I have a Undecorated Modal JDialog which I want to setVisible(false) when the user clicks outside of the modal dialog. Is this possible in Swing? What I am doing is popping up a custom editor for a text field like a date selector. Is there an…
Pyrolistical
  • 27,624
  • 21
  • 81
  • 106
8
votes
3 answers

How to make JFileChooser Default to Computer View instead of My Documents

In the Windows Look and Feel for JFileChooser, the left hand side of the JFileChooser dialog shows five buttons: Recent Items, Desktop, My Documents, Computer, and Network. These each represent Views of the file system as Windows Explorer would show…
shawmanz32na
  • 1,260
  • 3
  • 15
  • 19
8
votes
1 answer

Modeless JDialog needs to be visible on top of parent

My application offers the ability to launch a long-running task. When this occurs a modeless JDialog is spawned showing the progress of the task. I specifically make the dialog modeless to allow the user to interact with the rest of the GUI whilst…
Adamski
  • 54,009
  • 15
  • 113
  • 152
1
2
3
68 69