I am developing a GUI using Swing and Netbeans Design features. I'm a beginner to Netbeans and wondering if there is any way to 'hide' a button by calling a method or by changing any settings in GUI builder.
In the design view, I did not notice any option(s) to modify buttons with a method, and the code generated in source view is protected which I cannot edit.
So, is there any way to modify or program how a Jbutton works?
To bypass the locking of Netbeans code you can see how in this post Bypassing Lock on Generated Code in NetBeans 6.5? .
Now if just what you want is to hide a button that is very easy using
this.jButton1.setVisible(false);
You need to find a way to unlock the source code.. It should not even be locked. Then find the button variable in the source code and hide it by writing:
ButtonNameHere.setVisible(false);
or if you just want to disable the button for a user, write
ButtonNameHere.setEnabled(false);
Related
It has been a few days that I've started using netbeans's gui designer.
I have built and tested all the panels I need for my project,
but today when I wanted to add some action listeners to my MainPanel.java class and tried to open it in design view, it didn't open.
It shows loading the panel but there is no sign of viewing it.
I can see the JPanel's code and I can see and open my other panels' design view.
It's only this one.
I searched the net but I couldn't find a proper answer.
Can anyone help me?
Does anyone have any idea what is the problem?
I'm using windows 7 and netbeans 8.0.2.
here are my design classes:
FinancialDocumentsJFrame.java
MainPanel.java
BillEntryPanel.java
ReceiptEntryPanel.java
SearchPanel.java
PaymentJFrame.java
I can open the design view of other classes. It's only MainPanel.java that dose not open and can see its code only. I'm also using some other java classes, too. Rather than form classes.
I made a new class and copied the existing class code in to it and it worked again.
Good Luck with your codes.
I'm making a Java Swing application where the user can run and edit JavaScript and Python code using a ScriptEngine. I want the user to be able to drag-and-drop design custom frames with standard components (buttons, text boxes, etc) and specify code to run when buttons are pressed or text is typed. I will also need a way to load and save the forms and run them inside my app. Are there any libraries I can use for this? I've tried searching around but I'm not finding much.
Right now I am working on a GUI application In java using the GUI builder that comes with NetBeans.
However I have found some kind of strange bug/feature, as I am no longer able to see the window that allows users to change between "source" and "design" (Design is the drag and drop NetBeans gui builder while source is the code where you can add your own methods and so forth).
NOTE: the red is censored information that is not necessary.
When I right click on a component to add event code, then it takes me to the source (without a window for me to change back to design, it goes back to design when i close and reopen it). So I know that NetBeans recognizes that this is indeed a JFrame form with the NetBeans GUI designer, and the source code is indeed availible..
I could not find any answers to this question on this site or on the web, I have tried resetting the windows but it did not work, I also couldn't find the window when I clicked on the window option. I am sure there is some easy question but I am unable to find it. Please forgive me if this was an easy question.
On the menu bar, try clicking View -> Show Editor Toolbar
I am creating a Java desktop application where the user will enter his name and age and press next, like given below in image 1.
And the action would perform would be like given in the image below in image 2.
I went through all tutorials on the Netbeans site, but still I was not able find any solution. I want to build this application like what we see when we install some application on Windows, we select some option and press next and a new window will appear with the result or more options. Please somebody help me with step by step instruction.
I don't think you'll get as much out of "step by step" instructions as you will going through the tutorials and learning not only how to do what you're desire, but the whys and hows of what you're doing. That being said, you will want to go through several of the Java Swing tutorials to learn how to do this including
the CardLayout tutorial to see how to swap JComponents in a GUI.
The JTextField tutorial to see how to interact with JTextFields
The JButton and ActionListener tutorial to see how to interact with JButtons and how to respond to their presses.
Much of learning to code means independent study and much trial and error. So start experimenting and have fun doing so!
As the above answer says, the CardLayout is a one way of doing this. However, in my case, I find that cardlayout is bit difficult for me. So, what I do is, creating JavaBeans, which extends JPanel, in this case. So you can add them to the main view and dispose/replace with another JavaBean, making different "Next" views. This way will help you to seperate your code into several classes, making the code simple too.
This article contains more or less a step-by-step tutorial on how to create a wizard in Swing. But before you start with that article make sure you have some basic Swing knowledge or that article will be complete Gibberish
You can use installation wizard creator tool for make a setup of your java application
for examaple you can use
"Setup Factory" tool for create a install exe of your application
it make a installer like that which you in your quetion
Is there a library out there that can facilitate in creating assist or automated guide that tells users what action to take?
Like it should notice the user is running the software for the first time so it will say click this button, and when the user does, it will explain other features.
sort of like what Youtube's video editor does but I wonder if this is achievable in swing.
I don't know what you call this...but below is a good example to aim for but something that works for Java Swing.
http://jeffpickhardt.com/guiders/
I would do this using JPanel or image and mouse events by setting their visbility properties. I haven't tried it but, I think I can...
I used these libraries which are for rich applications
http://java.net/projects/animatedtransitions/
http://java.net/projects/timingframework/
let me know if you found anything new.
thanks
from
vinay