473,698 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I use events with Netbeans?

Ok, here it goes... Since Netbeans declares all GUI inside a private method
I cant access them directly. So, on a button click, how can I do something
like jTextField1.set Text("Hello!"); ?

TIA,
Scirious.
Jun 16 '06 #1
10 8223
Scirious wrote:
Ok, here it goes... Since Netbeans declares all GUI inside a private method
I cant access them directly. So, on a button click, how can I do something
like jTextField1.set Text("Hello!"); ?

TIA,
Scirious.


If you just want to initialize then select on the object in your GUI
panel. Then you have to select the properties, of that object, on the
right side of the screen. You can add data there. I think the field is
'value'. You can still reference the Object outside of the "do not
Modify" code. Just reference it correctly.
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
_______________ _______________ _______________ _______________ ______________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Jun 16 '06 #2
Well, I want to use an event to change the proprerties and it seems that
I'm not refrencing the objects correctly. Could you give me an example?

TIA,
Scirious.
Jun 17 '06 #3
Scirious wrote:
Well, I want to use an event to change the proprerties and it seems that
I'm not refrencing the objects correctly. Could you give me an example?

TIA,
Scirious.

Sorry I did not get back sooner. Netbeans was having a problem with the
web package. Steps to set the text in the GUI builder for a component:

Ok..

1 - Select new Panel form. Save it.

2 - Select a JTextField from the Swing Palette and drag to new panel form.

3 - Select the new JTextField on your new panel. You can now do one of
two things with the same result:

A - right<click> on the JTextField and then select properties. Then
locate the Text property. You add you String data there on the right of
the Text label.

B - On the right side JTextField properties panel find Text property.
You add you String data there on the right of the Text label.
Just noticed in you message header you are asking about the changing
events with Netbeans.

To do that you do the same as above to get to the object property list.
This time select 'Events' and not 'Property'. Find the event you want to
add code to and you are good to go...
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
_______________ _______________ _______________ _______________ ______________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Jun 17 '06 #4
Ok, thanks, but howI cange the same text only after the nouse clicked the
button?
Jun 17 '06 #5
Scirious wrote:
Ok, thanks, but howI cange the same text only after the nouse clicked the
button?


Sorry, I did not understand that question.. Are you asking how do you
change it programmaticall y?

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
_______________ _______________ _______________ _______________ ______________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Jun 17 '06 #6
IchBin wrote:
Scirious wrote:
Ok, thanks, but howI cange the same text only after the nouse clicked
the button?


Sorry, I did not understand that question.. Are you asking how do you
change it programmaticall y?


Sorry, I just want back and reread your initial question. I just created
a quick panel and added a button and other gui objects.

They are defined as private instance objects in the class and not to
method.

If trying to set or get the objects.text from a different Class then the
solution is to add a *protected* getter() and setter() for the button
object under that owner class. You will then be able to change them that
way and still keep it secure..

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
_______________ _______________ _______________ _______________ ______________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Jun 17 '06 #7
Actually, in the version I have here, which is Netbeans 5.0, they are
defined inside the init method.
Jun 18 '06 #8
Scirious wrote:
Actually, in the version I have here, which is Netbeans 5.0, they are
defined inside the init method.


Well, that explains it. I am running 5.5..

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
_______________ _______________ _______________ _______________ ______________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Jun 18 '06 #9
Scirious wrote:
Actually, in the version I have here, which is Netbeans 5.0, they are
defined inside the init method.


Well, that explains it. I am running 5.5..

You could post the code to figure it out. You could move the definition
out of the init() but still initialize them there.

Sorry but personally I do not use GUI builders for many reasons. I look
at them just because I think they are cute. I have learned it is better
to understand how to code it. You can use it for simple layouts but then
if it is simple it faster for me to just code it.

The only code I do differently is to use the JGoodies Form Layout and
not Sun's
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
_______________ _______________ _______________ _______________ ______________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Jun 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3967
by: King W.Wang | last post by:
Hi all, I've installed NetBeans IDE 3.5 on Windows XP. But if I try to start it, a message box shows "cannot load jvm.dll". This library does exist in a subdirectory. My questions are: 1) Is NetBeans IDE 3.5 a stand-alone software, i.e. can it run without other software, or should a java SDK be installed? 2) If NetBeans can run without java SDK, maybe one must set the path for
3
7804
by: Joseph Jolic | last post by:
Hi i just installed Netbeans on my windows pc and it installed fine. but when i try to run it i get: JDK 1.3 or later cannot be found on your machine. Please read the README file. i read the readme file but to no avail..i'm still working on the problem, but i thought posting it might save me some time. if anyone knows what to
1
2476
by: tmb | last post by:
I'm a newbie to Java. At http://java.sun.com/j2se/1.4.2/download.html I see I can download... NetBeans IDE + J2SE SDK as a 'bundle' I beleive is both NetBeans and the Java SDK... My Question:
0
2032
by: Federico | last post by:
Hi all, I don't know if this topic is perhaps a little bit off-topic, anyway I have a strange problem in transforming an XML file in an HTML file using XSLT form a Java program written with NetBeans. I utilize the javax.xml.transform class and in the computer where I wrote the program all function perfectly, calling the input XML file, the XSLT stylesheets and setting where to write the output HTML.
20
4635
by: Bill DeWitt | last post by:
I downloaded the Sun product, and find it feature rich but slow. Can someone recommend a more basic (freeware) IDE which will help a newbie without hiding every bit of code? I can program my way out of a wet paper bag in a few languages, but want to by-pass some of the learning curve for this project.
1
2983
by: tatamata | last post by:
Hello. I installed NetBeans, Jython and Coyote. I hoped that I could use Swing GUI builder intergrated in NetBeans (Matisse?) with Jython in "Delphi" way. But, it seems that I can drag and drop controls only in pure Java application, not in Jython application? Does anybody uses NetBeans as GUI/RAD tool for Jython/Python? Regards, Zlatko
3
2909
by: arasub | last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.5.0_12\bin;.;C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\j2sdk_nb\j2sdk1.4.2\bin;C:\Program...
0
2724
by: buk110 | last post by:
Hi everyone, I'm new to using JAVA and I'm trying to interact with a web service I wrote in C# I downloaded Netbeans & followed the instructions to point to the wsdl file I navigated to my WSDL file http://localhost/myService/myService.asmx?WSDL And Looking at the output of 'Web Services Manager' I see the following
0
3107
by: sokeefe | last post by:
I use NetBeans IDE to develop a Java application. In the past, I could use the Design Editor to edit my form for the GUI. Spontaneously, NetBeans is unable to open the form file, producing this pop-up message labled as "Information": "The form file format is not recognized. The form cannot be opened." This error was allegedly fixed in previous versions of NetBeans. I have the latest version of NetBeans and I am getting this error now,...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8898
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.