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
7
votes
3 answers

wait for jdialog to close

I have a class FilePathDialog which extends JDialog and that class is being called from some class X. Here is a method in class X projectDialog = new FilePathDialog(); projectDialog.setVisible(true); …
ed1t
  • 8,719
  • 17
  • 67
  • 110
7
votes
3 answers

Is there a way to change the owner of a JDialog?

I have a very specific problem, and I wanted to know if there is a way to change the owner of a JDialog (it can be set using the constructor). I suppose there is no "official" possibility (other than a hack), but I wanted to make sure I didn't miss…
roesslerj
  • 2,611
  • 5
  • 30
  • 44
7
votes
2 answers

Why are the Window/Component Listeners invoked differently when setVisible(false) and dispose() are called?

The difference I see is (running on JDK 1.7): setVisible(false), invokes componentHidden but not windowClosed (The API states only on dispose() so it's OK even if it irritates me) but dispose(), invokes windowClosed but not componentHidden Short…
Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
7
votes
3 answers

how to ensure that JDialog always stays on top

I have a JDialog that takes a name from the user. Behind the JDialog, is an applet. I dont want the user to access that applet until he has entered the name. I tried JDialog.setAlwaysOnTop(true), but the applet throws an AccessException error. So…
mithun1538
  • 1,447
  • 8
  • 25
  • 32
7
votes
2 answers

Swing: set a fixed window size for JDialog

I tried setPrefferedSize and setSize methods, but the dialog still opens at minimum size. private void method() { commandDialog.setPreferredSize(new Dimension(100,100)); - - - - - - //Components added to dialogPanel …
dev
  • 2,474
  • 7
  • 29
  • 47
7
votes
4 answers

Returning value from JDialog; dispose(), setVisible(false) - example

I know, that this question appears quite frequently in SO like here: but I would like to present some very specific example... I'm simply not sure if I make things right. I've got a JDialog in which I can type some values, select some checkboxes...…
radekEm
  • 4,617
  • 6
  • 32
  • 45
7
votes
3 answers

Undecorated JDialog border

I have a question regarding the border around an undecorated JDialog using the Metal L&F. Look at this picture to see the border that is on this window: I'm trying to figure out how to either get rid of or change the color of the blue border…
Mark
  • 418
  • 1
  • 4
  • 13
7
votes
3 answers

How to figure out on which screen a JDialog is shown

I have a really big application which has multiple dialogs. My task is to make sure that a dialog, which is not completely visible (because the user pulled it out of the visible screen area) is moved back to the center of the screen. That's no…
gilaras
  • 310
  • 4
  • 14
6
votes
2 answers

JOptionPane vs. JDialog

This is a crosspost to the thread in Javaranch (includes some images): http://www.coderanch.com/t/567472/GUI/java/Optimal-solution-creating-multiple-dialog I'm trying to develop a simple swing desktop application where I imagine alot of different…
Kristjan Toots
  • 81
  • 1
  • 1
  • 3
6
votes
1 answer

Creating a custom blocking Java Swing prompt

This problem is solved. I'm am developing a Java Swing based projected, and the look & feel of the application is completely customized. We are trying to maintain a consistent appearance throughout the program, and the default Java dialog windows…
Reivax
  • 127
  • 2
  • 9
6
votes
4 answers

Show JDialog ("Please Wait") on JFrame

I have a JFrame and this JFrame has a JButton. I want in JButton first show JDialog (display "Please wait") and execute other code then closing JDialog. But when showing JDialog stopped to execute other code on JButton.
or123456
  • 2,091
  • 8
  • 28
  • 50
6
votes
4 answers

Java Dialog - Find out if OK is clicked?

I have a dialog for a client-GUI that asks for the IP and Port of the server one wants to connect to. I have everything else, but how would I make it so that when the user clicks "OK" on my dialog box, that it runs something? Here's what I have so…
user569322
6
votes
3 answers

JOptionPane.createDialog and OK_CANCEL_OPTION

I have a custom dialog box that collects two strings from the user. I use OK_CANCEL_OPTION for the option type when creating the dialog. Evertyhings works except when a user clicks cancel or closes the dialog it has the same effect has clicking the…
banyard
  • 149
  • 2
  • 2
  • 9
6
votes
2 answers

Font size of JDialog title

How do I set the font size of the title of a JDialog. I'm displaying JDialogs on extremely high resolution monitors (5 mega pixels), and the dialog titles are not legible. I need to do this on a per dialog basis because the application is…
Jon
  • 3,985
  • 7
  • 48
  • 80
6
votes
4 answers

Setting the maximum size of a JDialog?

The short version: do I need to do something tricky to get JDialog's setMaximumSize() to work? The full version: I've got a JDialog (layout manager: BorderLayout) which contains a scroll pane and a JPanel on the bottom with the commit buttons. The…
Electrons_Ahoy
  • 36,743
  • 36
  • 104
  • 127
1 2
3
68 69