How do I create a Java bean using NetBeans?

I know Java and NetBeans.  However, I've never created a Java Bean using NetBeans.  How do I do this?
LVL 1
HLRosenbergerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

anilallewarCommented:
A java bean is a plain POJO with getter/setters for each fields and a default no-args constructor. You can create any java class as a java bean.
0
HLRosenbergerAuthor Commented:
Can a Java Bean have a visual component?   By  getter/setters, you mean for each piece of data within the object, I need a method to get its value and a method to set its value.  Do the getter/setters have to follow any naming convention?
0
HLRosenbergerAuthor Commented:
I assume the bean does not have a main()
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

anilallewarCommented:
No..main points
1. No arg constructor; no other constructor
2. NO main
3. All property have a get<Property>/is<property> if boolean and set<Property> methods

Eg.

boolean check;
//The method name should be name of variable with first letter capital
public void setCheck(boolean check){
           this.check = check
}

public boolean getCheck(){
       return this.check;
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anilallewarCommented:
Could also be method below only for methods returning boolean

public boolean getCheck(){
       return this.check;
}
0
robthewolfCommented:
I think you mean isCheck
0
anilallewarCommented:
yups, my mistake :)
0
HLRosenbergerAuthor Commented:
Great!  Thanks for your help.

Has anyone ever used a Java Bean within i-net Crystal Clear?  I have written a very simple bean that has a list box and a button and extends java.awt.Frame, which is a requirement of  i-net Crystal Clear.  I have inserted the bean into my report.   However, when I run thee report, my bean does not display.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.