f



Connecting JFrames in Netbeans

Hi Everyone,
                     I am using NetBeans to do a project and i was
wondering whether i could do the follows:

have 2 files :
one.java ----------> has JFrame1 -----------> has button1,textbox1
two.java ----------> has JFrame2

and when button1 in JFrame1 is clicked JFrame2 should appear and the
value entered in textbox1 is to be sent to two.java so JFrame2 can use
it. Is this possible if so plz help me ASAP thanks for your help in
advance. Any other suggestion arround this problem would be greatly
appreciated as well.

1
11/16/2006 6:58:47 PM
comp.lang.java.gui 8286 articles. 0 followers. Post Follow

5 Replies
7303 Views

Similar Articles

[PageSpeed] 16

Mithil wrote:
> Hi Everyone,
>                      I am using NetBeans to do a project and i was
> wondering whether i could do the follows:
>
> have 2 files :
> one.java ----------> has JFrame1 -----------> has button1,textbox1
> two.java ----------> has JFrame2
>
> and when button1 in JFrame1 is clicked JFrame2 should appear and the
> value entered in textbox1 is to be sent to two.java so JFrame2 can use
> it. Is this possible if so plz help me ASAP thanks for your help in
> advance. Any other suggestion arround this problem would be greatly
> appreciated as well.

I suggest obtaining a beginning Java text and working through that.
This is pretty elementary. I started with a book called Head First Java
and it got me up and running in just a couple weeks.

In the routine that is called by the button click, you would have the
lines:
JFrame2.setVisible();
JFrame2.setYourValue(textbox1.getText());

and in JFrame2 you would have a routine:
public void setYourValue(String s) {
....do whatever you wanted with the string that was in the textbox...
}

2
Jeff
11/16/2006 10:06:55 PM
Hi Jeff,
               Thanks for your reply but i still have one small problem
how would one.java file's class know about JFrame2 which is in two.java
?

1
Mithil
11/17/2006 9:01:45 AM
Mithil wrote:
...
> how would one.java file's class know about JFrame2 which is in two.java
> ?

If it is in a package with appropriate access rights,
import it.
If not in a package, it could be loaded by reflection,
but don't - put it in a package.

(And if those terms are mysterious, search on them
or ask on c.l.j.hlp - but still search on them first..)

Andrew T.

1
Andrew
11/17/2006 9:24:37 AM
Andrew Thompson wrote:
> Mithil wrote:
> ..
> > how would one.java file's class know about JFrame2 which is in two.java
> > ?
>
> If it is in a package with appropriate access rights,
> import it.
> If not in a package, it could be loaded by reflection,
> but don't - put it in a package.
>
> (And if those terms are mysterious, search on them
> or ask on c.l.j.hlp - but still search on them first..)
>
> Andrew T.

Or, even better, if they are in the same package they automatically
know about each other.

0
Jeff
11/17/2006 12:22:11 PM
hey thanks everyone i actually didn't even need to create a package
since it is in the same folder thanks a lot Jeff and Andrew.

-1
Mithil
11/19/2006 4:32:27 PM
Reply:

Similar Artilces:

java.lang.NullPointerException
>>>>>Hi! >>>>> >>>>>We are experiencing problems on a live application and are getting intermittent errors. The stack trace is as follows. As the system is live, this is urgent. >>>>> >>>>>java.lang.NullPointerException >>>>> at org.postgresql.Connection.ExecSQL(Connection.java:312) >>>>> at org.postgresql.jdbc2.Connection.setAutoCommit(Connection.java:141) >>>>> at org.enhydra.jdbc.standard.StandardXADataSource.getFreeConnection(StandardXADataSource.jav...

java.lang.NoSuchMethodException when trying to connect to DB2 with a connection pool
Hi, I've set up a DB2 8 database and I'm trying to connect to it with Sun ONE webserver 6.1 on AIX 5.2. When I test the webapp I get "auth failed server does not support this method/mechanism". After looking into it I found out the server only allows "Username only authentication" After adding "SecurityMechanism" to the Connection Pool parameters I get java.lang.NoSuchMethodException: com.ibm.db2.jcc.DB2SimpleDataSource.setSecurityMechanism(boolean). I'm not sure why it's sending the 4 as a boolean rather than as an int or short. ...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Cla...

about GUI and java netbeans
can you please help me to write a java program in netbeans.....actually I am using linux for the practice of java. On Sun, 20 Apr 2008 11:43:28 -0700, John wrote: > can you please help me to write a java program in netbeans.....actually > I am using linux for the practice of java. Honestly, I find it easier to to use the command line. However, if you're set on learning netbeans, have you tried a tutorial yet? -Thufir Words to the wise, John <anupam.iitg07@gmail.com> wrote: >can you please help me to write a java program in >netbeans.....actually I am using linux ...

java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Hi All I am having the torque3.1.jar and postgresql-7.4. I have compiled the new jdbc driver called as postgresql.jar and have placed it in the lib directory from where the ant scripts catch the jars. Whenever i try to access through torque gestList = BaseGestlistPeer.doSelect(new Criteria()); this error arises java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460) at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653) at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during compilation. but, to make it easier for the computer, > should i specify which class i really will be using? does this action > will boost the performance during compilation and runtime or not a > matter at all? Whether and how you import classes has exactly zero effect at runtime. Imports (with or without wildcards) are only a kind of abbreviation provided by the compiler to save us the effort of typing in fully-qualified type names every time. In theory explicit importing should make compilation faster -- by a very tiny amount. I've never heard anyone claim that they've even managed to measure a difference let alone found a case where it made a practical difference. So the question comes down to how to write your code for maximum clarity. One school of thought asserts that you should always import each class explicitly (rather than by a wildcard). There's a fai...

Learn about Gui.Lang.Java in series
In this website to learn more about Java and web Combination of Asp. 1. How to connect Java to web { xml,JavaScript}. 2. How to connect Asp to Web {xml,Ado.net,J2ee} The connection and web config is very important to Java and web with using Asp Dot Net. If you want connections more Information below links http://freejavaprogbooks.blogspot.com http://learnaboutweb.blogspot.com http://ganesh-freedotnetbooks1.blogspot.com On Jul 26, 12:22=A0am, Gani <ganeshkumar...@gmail.com> wrote: > In this website ... =2E.. What? ...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these commands: # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object # ls /usr/jdk/instances/ jdk1.5.0 jdk1.6.0 # uname -a SunOS sun1 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500 Please help to fix the error. Thanks. TsanChung wrote: > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > commands: > # zcat jdk-6u7-so...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type o...

java netbeans jtable defaulttablemodel
Hay! I am beginner in NetBeans. I have an aplication with JFrame. On it I have JTable and other things. I want to connect JTable with Vector. I tried with Vector vec = new Vector(); DefaultTableModel data = new DefaultTableModel(); JTable table = new JTable(data); but there is nothing in JTable on my JFrame (after I read file with data and wanted to insert it in JTable). I wanted to add data with method data.addRow(vec);. It works if I write code in TextPad and compile it, but I don't want to write such a long code in text editor. Have any suggestion? Thanks in advance, Simon On 18 ...

CheckBox in Column of JTable: Exception: java.lang.String cannot be cast to java.lang.Boolean
Hello, I have discovered a hidden error. My project was working for awhile, but then I started to get the below error. My error comes from the fact that I'm using a checkbox in a jtable, and I'm using the below "getColumnClass". Thank you, compile: run: Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean at javax.swing.JTable$BooleanRenderer.getTableCellRendererComponent(JTable.java:5412) at javax.swing.JTable.prepareRenderer(JTable.java:5735) at javax.swing.plaf.basic.BasicTableU...

java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Hi, I'm trying to use the httpclient within Jython (see http://jakarta.apache.org/commons/httpclient/ for more information on the httpclient). My Jython version is: Jython 2.1 on java1.4.2_04 (JIT: null) My Java version is: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) My CLASSPATH includes: jdom.jar xerces.jar jython.jar jt400.jar log4j-1.2.8.jar commons-httpclient-2.0.jar When I just try to perform the import statements from example code I get the error pasted below....

java program in java GUI
folks I am writing a java GUI that calls other java programs i want to execute java command line options in back ground. I am using java exec command this is part of code Runtime.getRuntime().exec("/root/java/jdk1.5.0_06/bin/java /root/Desktop/project/SAXXMLHandler"); where i want to run SAXXMLHandler java file But i dont get any output thanks CSUIDL PROGRAMMEr wrote: > folks > I am writing a java GUI that calls other java programs > i want to execute java command line options in back ground. I am using > java exec command > this is part of code > >...

Connecting a GUI to a Derby Database with NetBeans IDE
I try to follow up on the tutorial : Connecting a GUI to a DerbyDatabase with NetBeans IDEhttp://www.netbeans.org/kb/50/gui-database.htmlHowever, I get the following error when I try to perform execution :JdbcRowSet (execute) : Schema 'NBUSER' does not exsitI do perform check on jdbc:derby://locahost:1527/contact_databaseproperty, I do see there is a schema field, with value NBUSER.May I know what else I had missed out?Thanksp/s May I know what does it mean by schema? yancheng.cheok@gmail.com wrote: > I try to follow up on the tutorial : Connecting a GUI to a Derby > Database wit...

Netbeans 5.5 java.lang.OutOfMemoryError
Hello Everybody I am trying to compile pretty big project using NM 5.5 - SDK 1.4 During compilation the IDE throws Out of memory exception I have edited the following file ( As explained in : http://performance.netbeans.org/howto/jvmswitches/index.html ) C:\Program Files\netbeans-5.5\etc\netbeans.conf ----------------------------------------------------------------------- netbeans_default_userdir="${HOME}/.netbeans/5.5" netbeans_default_options="-J-Xms128m -J-Xmx512m -J-Xverify:none" netbeans_jdkhome="C:\Java\jdk1.5.0_09" And still the same exception: ---------...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object (ant/tomcat/spring)
Hi, I've been trying to get Spring working with ant and tomcat. Ant was building just fine, but I came in today and tried to build it and got this: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object ?!?! Makes no sense to me. There _is_ an older version of java installed on my machine; but JAVA_HOME and ANT_HOME are set to the correct paths, and <which java>and <java -version> produce the correct version. Any help would greatly alleviate my frustration! Thanks in advance... Courtney ...

general java GUI question : what is latest&greatest java GUI technology to front a mysql applications
(apologies up front if question is too broad or too dumb) I have intermediate java/mysql programming experience and want to take this up a notch and study java+mysql with a view to creating a database application for GUI programming currently I can see books on swing, JSP, JSF ..... its all a bit confusing as each work with JDBC but each are vastly different WRT how they construct a GUI I want to learn a java GUI technology that I can use to sit on top of a mysql database, typical tasks would be -o- form to read data into database (using many html controls -> text boxes, radio buttons, d...

java.lang.ArrayIndexOutOfBoundsException when i want connect me to Oracle 9i
Hi, when i want connect me in my BD with a JSP (with this simple code), this exception is throw. Thank's for ur help Mathieu CODE of my JSP --------------------- .... blah .... DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@139.165.123.198:1521:fultrans ","fultrans","g4g8888v"); .... blah .... EXCEPTION ---------------- java.lang.ArrayIndexOutOfBoundsException: 0 at oracle.jdbc.util.CryptDES.scrunch(CryptDES.java) at oracle.jdbc.util.CryptDES.des_dec(CryptDES.java) at oracle.jdbc.util.WorkBench.decrypt(WorkBench.java) at oracle.jdbc.ttc7.O3log.(O3log.java) at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java) at oracle.jdbc.driver.OracleConnection.(OracleConnection.java) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at org.apache.jsp.SelectPersUtilSsSaisie_jsp._jspService(SelectPersUtilSsSaisie _jsp.java:55) In article <c1l1q3$dp6@aix4.segi.ulg.ac.be>, CM says... > >Hi, > >when i want connect me in my BD with a JSP (with this simple code), >this exception is throw. > >Thank's for ur help >Mathieu > >CODE of my JSP >-----...

NetBeans 4.0 java.lang.UnsupportedClassVersionError 48.0
Where is everyone? Standalone apps classes compile and execute correctly in the project. Applets classes compile in the project and execute in the Appletviewer correctly. Web applications compile, in the project and lunch the TomCat 5.0 Sever Bundle and the default browser, but there is a conflict between the class compile version (jdk 1.4.2_08) and the runtime environment. The netbeans.conf file contains netbeans_jdkhome="c:\j2sdk1.4.2_08" Exp. init: deps-jar: init: deps-jar: compile: jar: compile: compile-jsps: run-deploy: Starting server Bundled Tomcat (5.0.28) Starting Tomcat p...

modifying java.lang.String.java
Hi, I'm trying to modify java.lang.String.java and add the modified String.class to rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED]. I cannot add "private final boolean tainted[] = new boolean[5];" to String.java. If I do, it still compiles and I can add it to rt.jar and compile a test program against it. However, the JVM crashes with a strange message: java.lang.IllegalArgumentException: name can't be empty at java.security.BasicPermission.init(Unknown Source) at java.security.BasicPermission.<init>(Unknown Source) at java....

java.lang vs java.util
Surprising to see something defined in java.lang <http://developer.android.com/reference/java/lang/Iterable.html> depend on something defined in java.util <http://developer.android.com/reference/java/util/Iterator.html>. Surely the hierarchy should go the other way? On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: > Surprising to see something defined in java.lang > <http://developer.android.com/reference/java/lang/Iterable.html> depend on > something defined in java.util > <http://developer.android.com/reference/java/util/Iterator.html>. > > Surely the hierarchy should go the other way? I think Iterable may make it into java.lang because of its significance in the foreach statement. Patricia On 04/02/2011 12:23 AM, Patricia Shanahan wrote: > On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: >> Surprising to see something defined in java.lang >> <http://developer.android.com/reference/java/lang/Iterable.html> depend on >> something defined in java.util >> <http://developer.android.com/reference/java/util/Iterator.html>. >> >> Surely the hierarchy should go the other way? Not if it wants to be consistent with http://download.oracle.com/javase/6/docs/api/ don't'cha think? And the so-called "hierarchy" of java.util and java.lang is that they are equal. The language reserves for itself the entire panoply of java.* and javax.* packages. > I think It...

Web resources about - Connecting JFrames in Netbeans - comp.lang.java.gui

List of Nebraska Connecting Link, Spur, and Recreation Highways - Wikipedia, the free encyclopedia
Nebraska Connecting Link , Nebraska Spur , and Nebraska Recreation Road highways are a secondary part of the Nebraska highway system . They connect ...

Israeli Hotel U Coral Beach Club Eilat Has a Unique Way of Connecting Guests to Facebook
U Coral Beach Club Eilat, a hotel in Israel , is taking sharing vacation photos and checking in to the next level thanks to a collaboration between ...

Digital Media Wire - connecting people & knowledge —
dmwnews : Anomaly, the ambitious graphic novel by Brittenham and Haberlin, features augmented reality. http://bit.ly/Iwrxjr Already optioned ...

Connecting 100 Million People in Africa
„Facebook for Business“ liefert dir aktuelle Nachrichten, Tipps und Best Practices für den Einsatz von Facebook zur Erreichung deiner Unternehmensziele: ...

Papa John’s Connecting with 200,000 Fans on Facebook
More brands are engaging with Facebook’s 150 million users through Facebook advertising solutions and the Facebook Platform, patterns of best ...

Home - WHLT 22 Connecting the Pine Belt Fan
Facebook is a social utility that connects people with friends and others who work, study and live around them. People use Facebook to keep up ...

US IT Staffing Recruiters Group - Connecting Ideas !
US IT Recruiter's Groups: IT Technical Recruitment. Its all about connecting to new Ideas !

Jewel Dots Puzzler - A Cool Connecting Dots Puzzle For Kids on the App Store on iTunes
Get Jewel Dots Puzzler - A Cool Connecting Dots Puzzle For Kids on the App Store. See screenshots and ratings, and read customer reviews.

Connecting the community, my Twitter strategy, and American Airlines at DFW - Flickr - Photo Sharing ...
I thought, to commemorate this entry on connecting people, that I'd include a photo of an airplane from one of the busiest airports in the world ...

Connecting an Arduino to a DSC 1550 Alarm Panel - YouTube
Have an old DSC-1550 (PC 1550) Alarm Panel? This video shows how to connect an Arduino to the panel, simulate a keypad, and monitor the state ...

Resources last updated: 2/24/2016 8:45:35 PM