Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm currently making a mortgage calculator, but I need some help. I have a reset button on my GUI that makes all of the forms blank again after typing something into them. The IDE already helped me make the button, so here is where I'm at:
private void resetActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
What do I need to put in here?
You either recreate your complete GUI (probably not an option), or painstakingly use .setText("") against each and every input field you have, and similar logic for radio buttons, etc. There's no royal way to it, unfortunately.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I want to perform some actions every time an Eclipse editor gains focus. In other words I will like to listen to tab switch performed on each editor part. Any help?
Use an IPartLister to listen to all part state changes and look for ones where the part is an editor:
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
window.getPartService().addPartListener(listener);
The various methods of IPartListener are given an IWorkbenchPart parameter, you need to check if that is an instance of IEditorPart.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
When I close to "Gelir Ekleme Alanı" then the main page close too. What am I doing for avoid this problem. It is my school homework and I must solve the problem.
enter image description here
I guess that you are in your JFrame saying something like
GelirEklemeAlanıFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
which makes the JFrame execute
System.exit(0);
when you press the red X which closes your whole application. But as you just want to close the window you have to change it to
GelirEklemeAlanıFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
which just closes this frame or create a custom exitListener. If you want to make a custom exitListener to add some extra behaviors on exit, just look up on the internet for "exitListener in java swing" or JFrame.
Hope I helped you :) Good luck in school!
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to create JLabels in a loop and remove them at the End. So I need to give every Label its own name (Like Label[1], Label[2],...). I'm very new to Java so I can't imagine how to solve this problem. I already tried different ways but they all didn't work.
I am not sure but you can add a number of anonymous objects(in this case they will be JLabel or Label) to the Array List without naming them.(You need to use for loops). If you want to delete them, you need to use the same logic.
Let me know this works or not. If you stuck again, I can help you by writing the code. However, writing yourself will be more beneficial for you.
Have a nice day !!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am a very new programmer, it is part of my degree requirements and I am having a hard time with it. I am working on basically a three part GUI and I am wondering how I would create a JTextArea that will display each item that is entered.
Start by taking a look at Creating a GUI With JFC/Swing, this will give you a basic grounding in how to use Swing.
Take a closer look at How to Use Text Areas for specific details about how to use JTextArea
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I put three buttons on my form, the focus is on the first one.
There's no response to the navigation buttons and i can't get to the other two buttons.
There's also no response to the main button (the first button isn't clicked).
I added action listeners and used setNextFocusRight() and nothing works.
What else do I need to do to enable navigation between components?
I believe your problem is that you haven't loaded any theme and all your buttons look the same (white or something). Navigation is working fine, but you can't see the result of pushing DOWN button.
addMnemonic is what you need i guess. Read this I think it will help you ))