Questions tagged [jdialog]
The main Java Swing class for creating a dialog window.
1,016
questions
0
votes
0
answers
34
views
How does java dialog inheritance work? I lose some properties
Sorry I don't have much knowledge about Java or swing applications. I created a dialog called DlgShape and in it i have 2 text fields, 2 buttons and 2 labels. I tried creating DlgRectangle and instead ...
-1
votes
1
answer
28
views
Stop execution of program until JDialog is exited
I am trying to open up a bunch of JDialogs one after another. The goal is that only after one JDialog is closed the next one is created. I have tried to use setModal(true) for the dialogs, but somehow ...
0
votes
0
answers
30
views
JFrame/JDialog shows no content [duplicate]
I am currently writing an app where the user sometimes needs to wait for longer periods of times. Therefore, i have created a progressbar that shows how far along it is. This seemed to work great at ...
0
votes
0
answers
26
views
How can I block JDialogs from appearing until a previous JDialog is closed?
I'm making a game in Java Swing and my level-up menu is a JDialog. On rare occasions it's possible for the player to level up twice in a short period of time, leading to level n's then level n+1's ...
0
votes
0
answers
14
views
Customizing JOptionPane in Java Swing [duplicate]
I'm developing a GUI, where I need some pop-up windows with a customized design, for example, the client can add a product to an order by filling a form, and this form will be in a pop-up window with ...
0
votes
1
answer
46
views
How I can use an auto increment in java for a register system? [closed]
I'm creating a register system for students using files, while I use the program the auto increment works fine, but when I ruin it again, the autoincremnt returns 1, also I am not allowed to use ...
0
votes
0
answers
29
views
How to jdialog to jpanel thread process
I have a question. I couldn't solve it for 4 days. I'm making a stopwatch using gui swing in Java. There are 1 jframe and 1 jdialog. I used threads in Jframe. It has a start stop and reset button, it ...
0
votes
1
answer
26
views
Jdialog disappears before usable
I have a strange problem: From a MenuBar I (or the user) can call two actions. One does importing some data, the other deletes some data. Both are presented through a JDialog. Now the weird thing is ...
-1
votes
1
answer
46
views
jTextField.setText() does not work in the Jframe
I created a simple jFrame with a jDialog, in this jDialog I have textfield just to get an ID, them, with this ID, use a webservice to search for the information and them show the information in the ...
1
vote
1
answer
67
views
Why does this JDialog not draw properly when called from a JFrame?
I'm having a problem with the display of a JDialog when called from a JFrame. The JFrame only contains a button. When pressed, this launches a JDialog with a JLabel, JTextField and JButton.
The JFrame ...
0
votes
0
answers
41
views
Block input while JDialog is open
I've a program that, when I open an image with JDialog, the consoles freezes, as expected, but if I write on the console while frozen, the scanner will catch what I typed, after I close the image, the ...
0
votes
0
answers
27
views
Prevent JPopup from going behind without the need for AlwaysOnTop()
I have a dialog that will open another dialog, is there anyway to keep the opened dialog on top of the main dialog without setting always on top? Example:
JPopupDialog mainDialog = new JPopupDialog(&...
0
votes
1
answer
52
views
Is there any way i can refresh a JDialog and remake it?
I have one main JFrame with one button, when i press this button, one JDialog open with some objects from a Json File. For each object i have a delete button. Everything works great but to see all ...
0
votes
0
answers
27
views
Dialog X/Y positioning
I want to display some user info relative to a mouse click. I converted a JOptionPane into a JDialog to accomplishment this. However, when invoking the message display, I have to pass evt.get?...
0
votes
0
answers
20
views
How I can close JDialog [duplicate]
I have code like this:
JOptionPane pane1 = new JOptionPane();
JDialog dialog1 = pane1.createDialog(null, "Window1");
dialog1.setModal(false);
dialog1.setVisible(true);
JOptionPane pane2 = ...
0
votes
1
answer
67
views
Cannot set maximum height of JEditorPane inside JScrollPane inside JDialog
So I want to achieve something very simple.
In my application, users can consult the content of some files.
First of all, the content of the files is in HTML, so I used JEditorPane to display it. ...
0
votes
0
answers
44
views
Mouse Click not Recognize in JDialog
I have a Component I created that extends JTextField,
the component shows a list of items as you are typing for auto-complete.
You can move within the list using the arrow keys and press enter, or ...
0
votes
0
answers
47
views
Properly adjusting the height of a JDialog to screen size
I have a JDialog and I am trying to adjust it to the size of the screen. I am using the setPreferredSize Method of the JDialog. Without me using the method, everything looks fine unless the screen is ...
0
votes
0
answers
40
views
Creating JDialog in actionperformed
I'm working on a swing application for reading a JSON file and then writing the same to a file. Action items will be listed in a JTable row that shows the metadata of the file and the last column of ...
0
votes
0
answers
37
views
MousePressed / MouseReleased events for user resizing (dragging) JDialog border
I am trying to figure out when users have resized my JDialog, because I want to make it snap to certain size steps after that. And I need to distinguish that from resize events caused by programmatic ...
0
votes
1
answer
28
views
JDialog.dispose() closes box but not the app. Clicking the corner cross closes both
NetBeans 12.3 / Java 15.0.2 / Ubuntu 16.04.
I created a Maven/Java app in NetBeans having just a JDialog with a single button which calls dispose(). Run it in NetBeans. If I close it with the cross in ...
0
votes
1
answer
139
views
Java swing: which component handles the mouse event to resize a JFrame or JDialog
Java 8 on windows 10.
I have a resizable JDialog.
I have tried the following code to see if I can capture the mousePressed & mouseReleased event when the mouse cursor changes shape at the edge of ...
0
votes
0
answers
31
views
JDialog under both Nimbus and Metal look and feel too wide
I have two simple JDialog dialogs that should be small. The first has a JTextField of 5 columns and a vertical slider under it. The second has a JLabel, a JSpinner and two JButton(s). Both, after ...
3
votes
1
answer
121
views
Hidden JDialog still visible in Windows 10 taskbar peek preview
A JDialog configured with HIDE_ON_CLOSE becomes invisible after closing it. But it is still visible in the peek preview of the Windows taskbar. The preview is corrected only after the main window is ...
0
votes
0
answers
72
views
Is there a way to stop an invokeLater or to create a JFrame at a certain time?
I am working on a little project, which in this example is made of 2 classes (and windows). Basically, when I click on a button placed on the JFrame 1, it open a JDialog, and then start the treatment ...
0
votes
1
answer
212
views
How to limit the dimensions of a JDialog
I'm working on a JDialog subclass (let's call it PendenciesDialog) which shows an arbitrary number of equally sized, vertically stacked JPanels to the user (minimally one) and a close button below ...
0
votes
1
answer
41
views
JDialog only load at the end of the program
I am using a JDialog for a project, which is load when I click on a button located inside a JFrame.
This JDialog is supposed to display an image, but the image appears only when the code called by the ...
1
vote
0
answers
32
views
Is the Icon buffered? [duplicate]
When I click on "Show dialog" button, it appears a JDialog that has a JLabel with an Icon (image), if the file "C:\Test\Test.png" exists the image appears correctly. I have an ...
0
votes
2
answers
339
views
Can't load an image when running a jar from maven project
I saw that this question has been asked many times, but I didn't find any solutions that works in my case.
I am trying to load an image and display it on a JDialog. That works when I am running the ...
0
votes
1
answer
40
views
JDialog is not showing up
I have this problem over and over again when i call my JDialog class is not showing anything this is the code for the JDialog interface:
public JMovie() {
JFrame f = new JFrame();
JDialog ...
0
votes
1
answer
361
views
Opening a Dialog from a MenuItem in Swing and validating that dialog before closing
I am somewhat new to UI Development in Java and Swing. I would like to open a dialog when I click an item in my JMenuBar and then validate that dialog before closing it (so pressing the X or the ok ...
0
votes
0
answers
76
views
Set tooltip text to close button of a JDialog
I programmed a JDialog to exit with ESC key and I would like to add a tooltip to the exit button that says "Close with ESC key", so that the user knows about it.
Does anybody knows how to ...
0
votes
1
answer
52
views
two dialogs setAlwaysOnTop(true): the second generated one is behind the first one
I have a JDialog which can generate another one. The two JDialogs have the property setAlwaysOnTop(true) and aren't modal. The second Jdialog generated from the first one appears always behind. I ...
0
votes
1
answer
24
views
How to get JDialog textFiels Value from JFrame
Hi I am new in Java coding and trying to design a user friendly desktop App with the help of JFrame and JDialog -
My JFrame is -
package com.myapp.ui;
import java.awt.BorderLayout;
import java....
0
votes
1
answer
58
views
Declaring a JDialog that has already been created
This question might not make any sense, because I am incredibly confused. I am creating a UI using Swing in Netbeans. I have created a Dialog box by using the Swing UI. I want to open this Dialog when ...
0
votes
0
answers
161
views
Change look and feel for JFrame after clicking on button from jdialog [duplicate]
I have a simple Java Swing app which should be able to change its look and feel (UIManager) afer clicking on a JButton in a JDialog of this JFrame. When I simply set UIManager.setLookAndFeel from ...
0
votes
1
answer
52
views
Hidden JDialog box
Recently, our Java application was a bit slower than usual, we just ignored it, because we use cloud DB which is a bit slow sometimes.
I used to navigate to other windows by pressing (alt+tab) in the ...
0
votes
1
answer
58
views
Dim background when opening JDialog in JFrame?
Is that possible. I tried setting opacity of the Jframe and set background but it didn't work out. Is there some easy and elegant way?
1
vote
1
answer
291
views
JFrame moves to the background for some reason
After I asked a very vague question about this topic yesterday here (which I voted to close now), I was able to pinpoint the problem and create a MCVE which shows this behavior.
The scenario looks ...
0
votes
0
answers
139
views
Why does my JFrame move to the background after closing modal JDialog
Edit: Updated question including a MRE and an answer can be found here.
I'm pretty lost after stumbling across this issue and finding no way to resolve it myself.
Description:
I have an application ...
-1
votes
1
answer
119
views
Is there a way to open multiple instances of modeless JDialog in java swing without disabling its components?
I have a GUI which consist of a JLabel named "View":
with a mouseClickEvent attached to it. Upon clicking on the "View" JLabel, i can open multiple instances of a modeless JDialog....
0
votes
1
answer
83
views
Swing wait() and notify() on JDialog, the dialog does not show its components
I have a mouse listener that gets invoked when I move the mouse in the application window.
In the MouseEntered method, I invoke a ThreadB as such:
@Override
public synchronized void mouseEntered(...
1
vote
1
answer
116
views
How to pass inputted data from JDialog to parent JFrame when user clicks button in JDialog?
How do I pass user-inputted date from a JDialog to the parent JFrame when the user clicks a certain button in the JDialog?
Here's how I want the program to work: When the user clicks a button in the ...
0
votes
1
answer
33
views
How to wait until JDialog is fully created
I need to calculate window decorations somehow. So I override JDialog's constructor. But when I call get_decoration_size() it sometimes returns wrong values. And my thought was: window creates later ...
0
votes
1
answer
44
views
Child JDialog appears blank when opened from parent jdialog
My swing code is as below. I have to use setAlwaysOnTop(true) for all jdialogs for some requirement in the project. If i use so the child dialogs which is launched from parent dialogs will appear ...
0
votes
1
answer
132
views
Minimize a resizable JDialog
I'm working on an swing application with a main window (which extends JFrame) from which several child windows can be opened (more than 1 contemporarily).
These windows are all non-modal and resizable....
0
votes
0
answers
123
views
JOptionPane.showOptionDialog too small on Mac
This is not a repeat of JDialog popup too small
I have a JOptionPane that stays up until the user presses Yes. My problem is that it displays correctly about 80% of the time and the other 20% it is ...
0
votes
0
answers
113
views
Modal JDialog disappear when clicking on parent Window
I'm trying to learn Java (not a programmer by profession).
I'm currently working on a calendar app with Postgres backend.
My app consists of a JFrame with two JPanels. One of those Panels is a ...
0
votes
2
answers
258
views
Getting the position of a Swing Component relative to the screen
I have a class called SuggestionField It will show the user a list of items to autocomplete his input. he let of inputs is displayed in a JDialog(suggestionFrame). I need to set the JDialogs position ...
2
votes
1
answer
241
views
JTextArea with line wrap reports incorrect preferred size to JDialog pack?
I am using multiple JTextAreas to display variable sized amounts of text, with LineWrap and WrapStyleWord both true. One application of this is displaying a JDialog with multiple of these text areas ...