jdialog

JDialog not showing minimize/close button on Linux

☆樱花仙子☆ 提交于 2019-12-12 22:31:08
问题 This question has been asked previously but from what I have found, the questions and responses are from a few years ago and hoping there is updated/new information. The same code works on Windows as it displays the X in the top right corner. On Linux, nothing appears in the top right corner. Windows is using JDK 1.8.0_60 Linux is using 1.8.0_111-b15 Based on the research, this issue is known to exist on varying flavors of Linux. import javax.swing.JDialog; public class JDialogSimple{ private

transparent JDialog becomes opaque when dragging to second screen (ubuntu 14.04 with Cinnamon, java 1.8.0_74-b02)

可紊 提交于 2019-12-12 16:34:26
问题 I created transparent JDialog which unfortunately does not work with two screens. When its dragged to other screen it becomes opaque. The code is below, just run it and drag label to other screen. public class TransparentFrame{ public static void main(String[] args) { JDialog dialog = createDialog(); SwingUtilities.invokeLater(() -> dialog.setVisible(true)); } private static JDialog createDialog() { JDialog dialog = new JDialog(); JLabel label = new JLabel("drag me to the other screen");

JDialog box not gaining focus

*爱你&永不变心* 提交于 2019-12-12 12:55:05
问题 I have a modeless dialog box being generated which prompts users to open a new window. The box can be opened in two ways, either directly from the file menu for the frame I'm writing or indirectly via the framework my panel is plugging into. When I make the call directly via the file menu the dialog box comes up with focus exactly as I want. But when I have the framework indirectly open the dialog box it does not have focus as it should. There doesn't seem to be a difference between the two

How to convert a JOptionPane to a JDialog

爷,独闯天下 提交于 2019-12-12 12:27:55
问题 I need to convert a JOptionPage to a JDialog, because I need to get rid of that quirky "OK" button. Below is the code... JOptionPane.showMessageDialog(null, Interface, caption, JOptionPane.WARNING_MESSAGE, icon); Interface is my GUI, "caption" is the title, then I have a warning message, then I have my custom icon. This might not even be possible with the given info, but I really need to get rid of that OK. Any help would be appreciated. 回答1: Why not simply create a JDialog and put your

Communication between JOptionPane buttons and a custom panel

走远了吗. 提交于 2019-12-12 12:08:17
问题 I have made a multiple input dialog by building a JPanel with the fields I want and adding it to a JOption pane JMainPanel mainPanel = new JMainPanel(mensaje, parametros, mgr); int i = JOptionPane.showOptionDialog(null, mainPanel, "Sirena", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, new String[] {"Aceptar", "Cancelar"}, "Aceptar"); However I'm having trouble with the buttons, because some of the fields are required. How can I make the "Ok" button to be enabled once every

How to close multiple JFrame and JDialog windows?

独自空忆成欢 提交于 2019-12-12 03:18:33
问题 I'm working on a program which has multiple JFrame and JDialog windows. I have a JFrame which contains a button, when I click on this button a JDialog window opens up. In this JDialog windows there is another button, which when is clicked it opens up a second JDialog window. In the second JDialog window I have a last button. What I want to do is to close both JDialog windows and JFrame window when this last button is clicked. This is how the opening order is: JFrame Frame1; JButton Button1;

JFrame is not removed from the taskbar

a 夏天 提交于 2019-12-12 01:05:07
问题 This question is related to my previous question Showing JDialog on taskbar does not look good. I have modified my code so that the dialog is displayed correctly but now the problem is that the button does not disappear from the taskbar when the dialog is closed. So the application runs, a dialog is displayed and a button is created in the taskbar for it. When I choose YES or NO, the dialog is closed but the button remains in the taskbar. For this reason, buttons add up in the taskbar each

JDialog blocks parent window on Windows

对着背影说爱祢 提交于 2019-12-11 22:52:53
问题 I have some problem with JDialog. I have Swing GUI created in NetBeans. GUI contains main frame with buttons, text fields, etc. When I click 'Next' button then JDialog (created aslo in NetBeans, Other Components section) is showing. Below are custom properties for this JDialog: modal = true; resizable = false; default close op = DISPOSE The problem is that, on Windows XP (probably 7 too), when JDialog occurs then I can't minimalize application by minimalize parent form. On Ubuntu it is

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

佐手、 提交于 2019-12-11 18:34:37
问题 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 prevent it from showing an instance in the gnome-panel? EDIT: So far I have tried playing with the modality, which hides it from the gnome-panel, but blocks the

Close all Java child windows

这一生的挚爱 提交于 2019-12-11 18:34:32
问题 In Java Swing is there a way to find and close all JDialog objects currently being displayed? I have a large application and there are multiple parts that can call to display a dialog but from one single point I want to be able to detect and close it. 回答1: Keep a reference to each of the dialogs (perhaps in a collection). When needed, iterate the collection and call dialog.setVisible(false) . As suggested by @mKorbel, you can also use: Window[] windows = Window.getWindows(); You'd just need