jdialog

swing: setting cursor on JDialog

Hi, I have a JPanel inside a dialog. A MouseListener listens to mouse movements, and when the mouse is on a specific location, I call setCursor() on the panel to change the cursor. This all works well, untill I open another dialog from within this dialog and close it again. (For example: a warning message (JOptionPane), or a new custom...

JDialog window controls component orientation (right-to-left)

Hi I have a question about mirroring the JDialog window controls (ie the close sign 'X', the title and so on) When I apply the right-to-left component orientation for a JDialog, it flips everything within apart from the window controls. I initially thought this is to do with the JRE I was using and the operating system regional languag...

Java: If a custom JDialog is hidden, is focus returned back to its parent?

I am creating a custom JDialog. I need to hide the JDialog (without removing it from memory) so that its parent can call a method on the JDialog (getResults()). JDialog dialog = new JDialog(.....); ///Code WITHIN JDialog: { //JDialog opens and its actions are performed this.setVisible(false); //Does this allow the parent to gain focu...

How to keep mainframe behind dialog when switching top-level windows?

Following situation: I have a JFrame and call JOptionPane.showInputDialog("test"). The modal dialog will be shown. When I then switch to another open window in Windows (let's say Firefox) and then return to my Java application (by clicking the tab in the windows task bar or with ALT+TAB) then only the dialog will be shown. Is it pos...

How do I prevent JDialog from showing in gnome-panel(Linux)?

I have a class: public class ANote extends JDialog{...} In GNOME(Linux) it shows an entry in the gnome-panel. I want it to show nothing (under Windows the instances of JDialog show nothing in the Windows taskbar), because there may be present several instances of the class simultaneously, and this overcrowds the gnome-panel. How do I ...

Mouse wheel not scrolling in JDialog but working in JFrame

Hello, I'm facing a frustrating issue. I have an application where the scroll wheel doesn't work in a JDialog window (but works in a JFrame). Here's the code: import javax.swing.*; import java.awt.event.*; public class Failtest extends JFrame { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() {...

When creating a dialog with jquery, how do I hide the dialog div?

I am creating a dialog like in this page: http://jqueryui.com/demos/dialog/#modal-confirmation (click view source) on the bottom is the div that gets placed in the dialog. The dialog works perfect when called by the javascript but the dialog is apparent at the bottom of the page when it loads. (minus all the styling that gets appli...

With jquery dialog boxes how do you apply a theme?

Example: http://jqueryui.com/demos/dialog/#modal-confirmation The example shown allows you to view the source and even has a theme selector at the top right. But how do you apply a theme to your own code? ...

how to know if JDialog is closed or not?

Hello everyone, I have used a JDialog to display a form ( I could have used JFrame, but I have my reasons). There is an event in my application that will cause a function to generate and display the said JDialog. Now, I want to know if the user has closed that JDialog. How do I find this out? P.S. My defaultCloseOperation is JDialog.DI...

Retrieve input entered in a JDialog

I extended JDialog to create a custom dialog where the user must fill some fields : How should I retrieve the data entered ? I came up with a solution that works. It mimics JOptionPane but the way I do it looks ugly to me because of the static fields involved... Here is roughly my code : public class FObjectDialog extends JDialog imp...

how to ensure that JDialog always stays on top

Hello everyone 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 what I did was keep a while loop that will execute JDialog.setVisible(true) ...

ClassCastException with JDialog and Thread

I have a JDialog with a thread in it. It sporadically gives me a ClassCastException when the dialog is created (which means I can have succesful ones with no exception), and I have no clue to where it should occur. Here's a snippet of my JDialog class public class ConfirmExitDialog extends JDialog implements Runnable, ActionListen...

How to bring JDialog to the top

I have created a java application. Now I write that if the JDialog is not present then It will create another JDialog but If its present then i set it as setVisible as true. But the problem is that if JDialog is there and after that i opened other applications like internet explorer then my application is not shown on top. So i made setA...

JWindow with Black Opacity

I would like to create a JWindow that's not only has an opacity, but I want to change the default color of the opacity within Swing. So for example, if I write: AWTUtilities.setWindowOpacity(this, 0.5f); This will make do exactly what I want with one exception, the color is white. How can I make the color become black? I've tried ev...

Hide JDialog window when the window lost focus.

Hi I have only one JDialog box in my Java application.I want to make it invisible if it lost the focus. I've tried different method, But didn't able to trigger any of the window focus events. Here is my code: public void windowGainedFocus(WindowEvent e) { System.out.println("gained focus"); } public void windowLostFocus(Windo...

Java - How to create Show/Hide details button ?

I am using Java Swing to create a JDialog, and i am trying to create a Show/Hide details button to show/hide a report at the bottom of this JDialog. It works fine for me, but i want to do this with time, to add a small animation effect while showing/hiding the report, i have used TimerTask but it's just showing the report directly witho...

Checkbox List in JDialog

I'm trying to use a JDialog box that has a search text field that as text is entered, it shortens a list to those that match. On this list I would like to display each line with a checkbox that can be selected. I might also want the ability for it to function like a select all list where Ctrl + Click on the line would select the item an...

Changing the value of jLabel in jDialog after loading it.

I've a JDialog with a JLabel. I want to change the value of label every 10 seconds. How can I redraw/repaint the JDialog with updated value in JLabel. ...

java jdialog taskbar button

hi, i'm traying a jdialog on linux, but it still appears in my taskbar. this is the code? what's wrong? import javax.swing.JDialog; public class Main { public static void main(String [] args) { new mydialog(); } private static class mydialog extends JDialog { public mydialog() { super(); ...

wait for a jdialog in non-modal mode

Hi, I have a JFrame and when the user presses a button is displayed an input jdialog. I need the jdialog to be in non-modal mode and once the user presses ok, I want to do some action based on the input. Right now I pass my view as reference in the jdialog, so that when the user presses ok, the jdialog calls a method of the view. Is th...