Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Newbie - basic questions about Javabeans
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

Report this thread to moderator Post Follow-up to this message
Old Post
zalek
03-21-08 03:08 AM


Re: Newbie - basic questions about Javabeans
zalek wrote:

> 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.


Report this thread to moderator Post Follow-up to this message
Old Post
Mark Space
03-21-08 09:31 AM


Re: Newbie - basic questions about Javabeans
On Mar 20, 11:18 pm, Mark Space <marksp...@sbc.global.net> wrote:
> zalek wrote: 
>
> You pretty much have to use jButton1.  You can change that name too.
> Right click on the component and select "Change variable name".
> 
>
> 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.

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

Report this thread to moderator Post Follow-up to this message
Old Post
zalek
03-21-08 01:08 PM


Re: Newbie - basic questions about Javabeans
Words to the wise, zalek <zalekbloom@hotmail.com> wrote:


>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.

Report this thread to moderator Post Follow-up to this message
Old Post
CK
03-22-08 12:13 AM


Re: Newbie - basic questions about Javabeans
zalek wrote:

> 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.

Report this thread to moderator Post Follow-up to this message
Old Post
Mark Space
03-22-08 12:13 AM


Re: Newbie - basic questions about Javabeans
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.
--

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

Report this thread to moderator Post Follow-up to this message
Old Post
Roedy Green
03-22-08 12:13 AM


Re: Newbie - basic questions about Javabeans
Roedy Green wrote:
> 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
.

--
Lew

Report this thread to moderator Post Follow-up to this message
Old Post
Lew
03-22-08 12:13 AM


Re: Newbie - basic questions about Javabeans
On Mar 20, 11:02 pm, zalek <zalekbl...@hotmail.com> wrote:
> 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

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

Report this thread to moderator Post Follow-up to this message
Old Post
zalek
03-22-08 01:06 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Beans archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 02:06 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.