jdialog

Resize a JPanel in line with a JDialog

Hi, I've got a JDialog which contains a series of JPanels in a CardLayout. Some of these panels contain JTables which I would like to be resized in line with any resizing of the JDialog. I am not sure how to achieve this and any help would be greatly appreciated. At present the tables simply remain their current size and do not scale...

Swing JDialog slow when running remotely

I have experienced performance problems for JDialogs while running my GUI remotely over X11. Does anyone know a workaround? The GUI is fast when I run it on my local machine, but sometimes we need to run it on a remote server - which causes a significant lag until the dialog is displayed. It takes about 2 seconds to create and display t...

Error Dialog Not Being Destroyed

I am working on a project that is using a JTable to display, among other things, a column of dates. We needed validation for the user input for dates, so I have implemented a combination of masking for format validation and parsing for actual date validation. I have done this using a custom CellEditor for the date column. Inside my Mask...

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 something. Any ideas or hints on the topic would be helpful, thanks already... ...

Why does JDialog 'jump' on setLocationRelativeTo()?

Have a class that extends JDialog. It's initialized entirely on EDT (just in case). Now, public PropsDialog (JFrame parentFrame) { super(parentFrame); // boring pack(); setLocationRelativeTo(getParent()); setVisible(true); results in dialog appearing in the leftmost corner and then jumping to it's intended position...

Troubleshooting: JDialog which is modal and yet not modal?

Stumped by this, but maybe, just maybe, someone has had this problem before and can point me in the right direction... I have a JDialog for displaying the progress of a long-running task, which I have expressly created as modal with a defined owner: progressDialog = new JDialog( ((Dialog)windowParent), true ); ... progressDialog....

Modal JDialog on Mac OSX freezes?

I have a modal JDialog pop up to get some user input in my app. I start a new thread and put setVisible to true after the JDialog is constructed. I can see in debug the last breakpoint hit is when the setVisible property is set. The code does indeed stop due to the modal setting waiting for this JDialog to close, but after a few seconds ...

Solaris 5.10: How do I hide a JWindow button on the task bar?

I am using a JWindow object in my Java application to simulate a mouseover dropdown menu. When the user mouses over a JLabel, the window appears and remains until the mouse exits either the label or the newly visible window. My problem is that each time the user performs this action, a new entry in the task bar at the bottom of the scr...

Programmatically close a JDialog

Is there a way to close a JDialog through code such that the Window event listeners will still be notified? I've tried just setting visible to false and disposing, but neither seem to do it. thanks, Jeff ...

Minimizable JFrame that stays on top of main application window.

My apps pops up a dialog. Users usually want to switch back and forth between this dialog and the application window for a period of time. I want this dialog to stay on top, so that it doesn't get hidden behind the main application window. But at the same time I want the dialog to have a minimize button so that it can get out of the way ...

JMenuItem accelerator not working after showing two non-modal JDialogs? (Mac only?)

I have the problem that the accelerators of JMenuItems aren't working anymore after showing two JDialogs directly after one another. Please take a look at this small example that reproduces the problem: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class DialogBug { public static void main(String[] args)...

Java Swing: JInternalFrame: need a dialog popup

I have a JInternalFrame window that needs to popup a modal dialog box when a JButton is pressed. At first, I tried using JDialog, but I found that JDialog constructor needs: JFrame boolean modal I tried passing JInternalFrame to it, but the type didn't match. Should I use JDialog with JInternalFrame? What if I dont specify the owner...

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 easier way to do what I want? EDIT Remember that modal blocks on the call to setVisible(tru...

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? ...

JDialog Not Displaying When in Fullscreen Mode

I have an application that runs in fullscreen mode and has been working fine. Now I need to add a simple, undecorated dialog and I'm running into trouble. If I run the application maximized but not in fullscreen, the dialog displays and functions as expected. When I switch back to fullscreen, the dialog will not display. The dialog e...

JDialog with minimize button

Is it possible to have a minimize and maximize button for a non-modal(modal=false) JDialog.I know JFrame is the ideal solution for this but this change has to be made in an existing code and its little difficult to change from JDialog to JFrame. ...

JDialogs cause my application's menus to disappear on OSX

Whenever any of my JDialogs have focus the toolbar does not display any menus accept for my applications main menu (it doesn't show file edit etc....). Is this an issue inherent to JDialogs/Swing or is this some sort of problem with how I made my dialogs? ...

Preventing unncecessaries duplicates of dialogs in Java Swing

Does exist in the JDialog class a way to prevent that a child window (JDialog) would be displayed more than once when the button from the main window (JFrame) used to open it, is pressed several times? Many thanks in advance! ...

How do I Hook a JPanel into parent/ancestor Container's windowClosing/Closed listener?

I want to create a 'generic' JPanel which can be rendered in any of the higher level Window classes (JFrame, JDialog, or JInternalFrame to be somewhat precise.) I want to be able to 'clean up' some static values when that window is no longer being rendered on screen. Normally, I would do this with a Window class (like JFrame) and simply...

swing: JPanel vs. modal/modeless dialog?

I want to implement some functionality in a library and make it available as a GUI building block for my applications. I think I would like to implement it as something that extends a JPanel, so it can be embedded as a component in other windows. Is there a reason I should use a JDialog instead? How easy is it to create a JDialog which ...