jwindow

Java Swing: JWindow appears behind all other process windows, and will not disappear

∥☆過路亽.° 提交于 2019-12-06 06:09:30
I am using JWindow to display my splash screen during the application start up. however it will not appear in front of all windows as it should, and it will not disappear as well. import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Toolkit; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JWindow; public class MySplash { public static MySplash INSTANCE; private static JWindow jw; public MySplash(){ createSplash(); } private void createSplash(

Update JLabel from another thread

隐身守侯 提交于 2019-12-01 12:37:46
问题 Dear guys, I'm having swing related problem. I cannot share the code since it's against the company policy, so I will try my best to explain the problem. In short, I have created a class that extends JWindow that contains a JLabel. This JLabel's text is updated randomly through a timer object, that instantiates a TimerTask every 50 ms using the scheduleAtFixedRate method. The values in the JLabel are retrieved by calling a method in a separate thread (let's call it transmission thread) that

Java Swing JWindow application crash

爷,独闯天下 提交于 2019-11-29 12:27:06
问题 If I use JDK1.8_40 or newer (Oracle or OpenJDK do the same), the following code together with a dialog resize will crash the application (tried Windows 7, x64, 64bit JDK) import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.JWindow; import javax.swing.SwingUtilities; import javax.swing.Timer; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Main { public static void main(String[] args) { SwingUtilities

How do I make my JWindow window always stay focused

荒凉一梦 提交于 2019-11-28 01:46:03
I am making a java application that includes a JWindow. I want to be able to track the mouse without the user having to click the window after going to another window. Your question is little vague on why you want to continue processing the mouse once it's left the JWindow ...but You have two (basic) choices when it comes to mointoring the mouse outside of your application, you can use a JNI/JNA solution or you can poll MouseInfo . The following demonstrates the latter, using MouseInfo and a javax.swing.Timer to update a label... import java.awt.BorderLayout; import java.awt.EventQueue; import