windowlistener
Java listener on dialog close
I have a Java app that displays a list from a database. Inside the class is the following code to open a new dialog for data entry:[详细]
2023-04-11 06:03 分类:问答Java - how do I prevent WindowClosing from actually closing the window
I seem to have the reverse problem to most people.I have the following pretty standard code to see if the user wants to do some saves before closing the window:[详细]
2023-04-10 08:26 分类:问答Closing a Swing Frame, user vs system initiated close. How to tell the difference?
When the user clicks the x to close the frame, I want to take one action. When Windows shuts down and triggers a close however, I wish to take a different action. Naturally, I will be using DO_NOTHING[详细]
2023-04-07 01:52 分类:问答Detect mouse click anywhere on window
I\'ve written a JWindow that acts a bit like a fancy menu in my application, popping up when a button is pressed. However, I\'d like it to disappear if the user clicks anywhere in the main window. I c[详细]
2023-04-01 16:23 分类:问答Java beginner: pattern to track object properties changes in dialog box (save prompt on dialog close)
There is some entity: public class Entity { private String name; public String getName() { return name; } public void setName(String name)[详细]
2023-04-01 02:00 分类:问答Closing a java program properly when JDialog is the main window
I have a JDialog as the main window in my application (originally it was a JFrame but it showed in the taskbar which I didn\'t want).[详细]
2023-03-30 22:30 分类:问答How do I add functionality to the exit button without System.exit(0)?
I went through and had the program System.exit(0) whenever the user clicked the window\'s red exit button. Is there a more efficient way to add functionality to that button?[详细]
2023-03-30 02:40 分类:问答Java swing closing message box
When the user closes my program, the program needs to shut down some background processes that might take a while to shutdown. So I want the user to be notified with a message box appearing and inform[详细]
2023-03-26 10:53 分类:问答How do I close a java application from the code
How do you close a java application f开发者_如何学编程rom the code?You call System.exit: System.exit(0);[详细]
2023-03-25 22:40 分类:问答Java Event Listener code not behaving as intended (beginner)
So I now have updated the code thus: but it still isn\'t setting the Strings to the inputs. import java.awt.*;[详细]
2023-03-24 09:06 分类:问答