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.

1000 questions
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
  • 19,652
  • 9
  • 51
  • 94
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,397
  • 7
  • 23
  • 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,274
  • 7
  • 23
  • 46
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...…
guitar_freak
  • 4,325
  • 6
  • 27
  • 43
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
  • 220
  • 3
  • 14
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
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…
philb28
  • 151
  • 1
  • 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,807
  • 6
  • 43
  • 73
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
  • 30,983
  • 34
  • 101
  • 126
6
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,453
  • 5
  • 29
  • 43
6
votes
4 answers

Swing modal dialog refuses to close - sometimes!

// This is supposed to show a modal dialog and then hide it again. In practice, // this works about 75% of the time, and the other 25% of the time, the dialog // stays visible. // This is on Ubuntu 10.10, running: // OpenJDK Runtime Environment…
Zarkonnen
  • 21,429
  • 14
  • 62
  • 80
6
votes
1 answer

Showing JDialog in taskbar not working

I'm using the below code to showing JDialog on taskbar and is perfectly working in JDK 1.6. public class test8 { public static void main(String[] args) { Runnable r = new Runnable() { public void run() { …
Nikhil
  • 2,817
  • 6
  • 30
  • 57
6
votes
3 answers

Is there a way to only have the OK button in a JOptionPane showInputDialog (and no CANCEL button)?

I've seen that this is possible in other types of dialog windows such as "showConfirmDialog", where one can specify the amount of buttons and their names; but is this same functionality achievable when using "showInputDialog"? I couldn't seem to…
Coffee_Table
  • 262
  • 1
  • 5
  • 13
6
votes
2 answers

To Add Minimize /Maximize button to JDialog orJPanel

Is it possible to add maximize/minimize button to the JDialog? if not then can we add these buttons to JPanel? I have a JPanel and inside that panel there is a JDialog.I want to add a minimize/maximize button such that when that button is clicked…
Nidhi
  • 217
  • 1
  • 4
  • 14
1 2
3
66 67