Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / March 2008

Tip: Looking for answers? Try searching our database.

Newbie - basic questions about Javabeans

Thread view: 
zalek - 21 Mar 2008 04:02 GMT
Hello,
I decided to write a simple application using Javabeans  in NetBeans
IDE 6.0.
I created a frame with few buttons and fields.
I gave a name to all fields and buttons. I switched from Design to
Source and I see code like this:

jButton1 = new javax.swing.JButton();
....
jButton1.setName("b_exit");

The above code cannot be changed.

My questions:
How I should I access object I created - I don't want to use name like
jButton1 - I want to use name I assigned like b_exit.
Is there any example of building simple application using JavaBeans?
Which book do you recommend for learning Javabeans?

Thanks,

Zalek
Mark Space - 21 Mar 2008 04:18 GMT
> How I should I access object I created - I don't want to use name like
> jButton1 - I want to use name I assigned like b_exit.

You pretty much have to use jButton1.  You can change that name too.
Right click on the component and select "Change variable name".

> Is there any example of building simple application using JavaBeans?
> Which book do you recommend for learning Javabeans?

This is Swing, not Javabeans.  Try to learn Swing.  I recommend
_Learning Java_ by O'Reilly, it's a good introduction to Java, including
Swing.  Once you get a handle on that, Sun's Tutorial becomes easier to
read and understand.
zalek - 21 Mar 2008 12:21 GMT
> > How I should I access object I created - I don't want to use name like
> > jButton1 - I want to use name I assigned like b_exit.
[quoted text clipped - 9 lines]
> Swing.  Once you get a handle on that, Sun's Tutorial becomes easier to
> read and understand.

Mark,

My question was related to Javabeans IDE. In this IDE you build GUI
similar way as in VB or Powerbuilder - you do not use explicitly any
layout manager - IDE is doing this work for you. I created GUI, it is
displayed - my question was how to programaticly change contents of
this GUI.

Zalek
CK - 21 Mar 2008 14:55 GMT
>My question was related to Javabeans IDE. In this IDE you build GUI
>similar way as in VB or Powerbuilder - you do not use explicitly any
>layout manager - IDE is doing this work for you. I created GUI, it is
>displayed - my question was how to programaticly change contents of
>this GUI.

Arent you talking about NetBeans?
--
Claus Dragon <clauskick@mpsahotmail.com>
=(UDIC)=
d++ e++ T--
K1!2!3!456!7!S a29
"Coffee is a mocker. So, I am going to mock."

- Me, lately.
Mark Space - 21 Mar 2008 17:03 GMT
> My question was related to Javabeans IDE. In this IDE you build GUI

No, you said "NetBeans".  I use NetBeans 6.0.1 and I'm familiar with
Matisse, the GUI builder.

JavaBeans is different from NetBeans.  JavaBeans is a spec.  NetBeans is
an IDE. Very different.
Roedy Green - 21 Mar 2008 18:35 GMT
On Fri, 21 Mar 2008 03:18:04 GMT, Mark Space
<markspace@sbc.global.net> wrote, quoted or indirectly quoted someone
who said :

>This is Swing, not Javabeans.  Try to learn Swing.

see http://mindprod.com/jgloss/swing.html

JavaBeans is an idea that never went anywhere.  All that is left of it
is the get/setter naming convention.
Signature


Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Lew - 22 Mar 2008 00:07 GMT
> JavaBeans is an idea that never went anywhere.  All that is left of it
> is the get/setter naming convention.

That is not fair, nor true.  JavaBeans events and property sheets are used
still.  By those who know of them.  For example, many IDEs use them that way.

Signature

Lew

zalek - 22 Mar 2008 13:41 GMT
> Hello,
> I decided to write a simple application using Javabeans  in NetBeans
[quoted text clipped - 18 lines]
>
> Zalek

Thanks for all replies - maybe I didn't explained clearly what was my
problem.
I am using IDE NetBeans to create a JFrame and Java program to use
this JFrame. The problem was that IDE Netbeams created names like
JButton1, JButton2 etc, while I wanted to use "human" names like
t_name or t_user. Using properties of the objects name was not
changed, only command .setName was used.
I found that mouse right click on an object changes object name - this
is what I wanted.
Thanks,

Zalek


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.