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
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
  • 22,200
  • 14
  • 65
  • 81
6
votes
1 answer

JDialog Close button event

For my custom JDialog, setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); has been set. There is a button on the JDialog. Based on a condition, it calls dialog.dispose(). Both these actions trigger the windowClosed event. But…
DSP
  • 61
  • 1
  • 3
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,857
  • 9
  • 34
  • 58
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
  • 14
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
6
votes
2 answers

Java can't call simple JDialog built using eclipse WindowBuilder

I'm trying to make a custom JDialog using windowBuilder, but at the very beginning I faced some issues. So here they are: I created simple Jdialog using windowBuilder. Here it's code: public class GroupFrame extends JDialog { private final…
mr.nothing
  • 5,141
  • 10
  • 53
  • 77
6
votes
4 answers

JDialog fixed height

Possible Duplicate: JDialog allow user to only change width of the dialog I have a JDialog that I would like the width to be resizable, but the height not. This is my current code: addComponentListener(new ComponentAdapter() { @Override …
Josh
  • 6,046
  • 11
  • 52
  • 83
5
votes
3 answers

JFrames and JDialogs sometimes open up behind their parent windows but have focus

We are developing a rather big Java enterprise application with a traditional Swing client. Every now and then, we facing the problem that random JDialogs and JFrames open up and getting the focus, but are hidden behind their parent windows.…
Stefan Kolb
  • 81
  • 1
  • 4
5
votes
2 answers

Disable JFrame when a new JFrame is opened

I am trying to disable the "main" JFrame when the new frame pops up. I want it so you can not click or drag anything on that frame. I tried making the new frame a JDialog, but that did not disable the other frame. I also looked at the other post…
Captain Gh0st
  • 177
  • 1
  • 3
  • 11
5
votes
2 answers

how to make JDialog inactive

I want to make JDialog-based window inactive, so all controls apeared disabled (in grey color). setEnabled(false) just makes impossible to click any control, even close window. But nothing turns gray. Help please. EDIT: Here is sample code. import…
Aleksandr Kravets
  • 5,750
  • 7
  • 53
  • 72
5
votes
1 answer

JDialog with WindowListener - windowClosing not fired

I have a class that extends JDialog that have a window listener: class MyClass extends JDialog { public MyClass() { setDefaultCloseOperation( JDialog.DO_NOTHING_ON_CLOSE ); addWindowListener( new WindowAdapter() { …
user800014
5
votes
1 answer

Java -- JDialog unmovable

What code will facilitate making a JDialog unmovable? I've looked at two options: setUndecorated(true); which works but removes all the trimmings. addComponentListener and overriding the componentMoved() method, which causes the JDialog to…
farm ostrich
  • 5,881
  • 14
  • 55
  • 81
5
votes
2 answers

Keep a jQuery dialog in a div

I am trying to create a number of jQuery dialogs but I would like to constrain their positions to inside a parent div. I am using the following code to create them (on a side note the oppacity option is not working either...): var d= $('
user400055
5
votes
4 answers

Modal dialog hide behind Main Frame after swich focus

I have a swing application, basically, a main frame that could pop up a modal dialog. When the modal dialog is showing, if I switch to another window, like firefox. And then switch back to the swing application. The JDialog is not in front any…
Leon
  • 8,151
  • 11
  • 45
  • 51
5
votes
1 answer

MouseListener event MouseExited doesn't work on undecorated dialog over disabled frame

i've got some trouble with the mouseExited event. I have one undecorated JDialog with a MouseListener, this JDialog is half over one disabled JFrame. The mouseExited event is fired when the mouse exit dialog and go on the desktop, but if the mouse…
Ap0k
  • 71
  • 2