Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners coding problem in netbeans

Have Programming Question? Ask it here!
 
 
 


Abhijit Mukherjee
coding problem in netbeans
1 Answer(s)      5 years ago
Posted in : Java Beginners



Advertisement
View Answers

August 20, 2009 at 3:52 PM


Hi Friend,

We are providing you a code where TextField of ClassA get the text from the TextField value of ClassB.

1)ClassA.java

import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;

class ClassA{
JFrame frame;
JTextField text1;
void form()
{
frame=new JFrame("test");
JPanel cp=new JPanel();
text1=new JTextField(10);
cp.add(text1);
frame.add(cp);
frame.setSize(300,100);
frame.setVisible(true);
}
}

2)ClassB.java

import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.awt.event.*;

class ClassB implements ActionListener
{
JFrame f;
JTextField text;
JButton jb;
ClassA m;
public static void main(String args[])
{
ClassB s=new ClassB();
s.form();
}
void form()
{
text=new JTextField(10);
jb=new JButton("Submit");
f=new JFrame("test");
JPanel cp=new JPanel();
cp.add(text);
cp.add(jb);

jb.addActionListener(this);

f.setSize(300,100);
f.setVisible(true);
f.add(cp);
}
public void actionPerformed(ActionEvent ae)
{
m=new ClassA();
m.form();
m.text1.setText(text.getText());
}
}

Thanks


Related Tutorials/Questions & Answers:
coding problem in netbeans - Java Beginners
coding problem in netbeans  hi, i have just started programming in netbeans,i'm facing a problem in a java application i create a jframe class and jbutton and jtextfeild inside it now i have created another class c1
netbeans coding prob - IDE Questions
netbeans coding prob  hi, i have just started programming in netbeans,i'm facing a problem in a java application i create a jframe class... ME HOW TO DO IT IN NETBEANS. THANK YOU  Hi Friend, Please visit
Advertisements
problem in coding
problem in coding  i have a following code which display the contents of the text file but not other program like java or any c program is there any handler to open the program files other than Filereader. FileReader fr = new
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
jdbc and swing problem in netbeans
jdbc and swing problem in netbeans  i reteived the table from database in a jdbc program. next i want to do is place the table as it is in a jpanel.. i am using netbeans IDE can u tel me how to do that one?? urgent
oracle connectivity problem with netbeans
oracle connectivity problem with netbeans  sir I am using oracle window version +net bean6.8. jam trying to connect net bean to oracle. for this after adding new driver(ojdbc6.jar) in services tab I got connectivity with oracle
problem i coding
problem i coding  i have a problem in coding a combobox containing a number of *.java program on click one of them that program should compile and run and display the result in other window
coding problem - Java Beginners
coding problem  i used netbeans software to develop frame.now i need to add values to JList from ArrayList object  Hi Friend, Try the following code: import java.util.*; import javax.swing.*; public class
Please provide the coding for this problem
Please provide the coding for this problem  Please provide the coding for the following problem. Write a "hangman" game that randomly generates a word and prompts the user to guess one letter at a time. Each letter in the word
struts 2 problem with netbeans - Struts
struts 2 problem with netbeans  i made 1 application in struts2 with netbeans but got one errror like There is no Action mapped for namespace... please give me acton mapping problem solution   Hi Friend, Please
coding problem - JSP-Servlet
coding problem  dear sir i m very new to JSP sir i m getting problem in dynamically changing the option of combobox from database(ms acess) .and after that option being selected for that the record from the databse should
coding problem - Java Beginners
coding problem  hi friend! Im new to jasper reports.how can i start that coding inorder to generate reports.can u send some sample programs for reporting?im badly need some clearly mentioned example because im new to jasper
Problem about coding in ajvascript
Problem about coding in ajvascript  I created a three radio buttons in the following way How many iphone styles are present in the image? <input type="radio" name="option" id="option" value="01" /> 01<br />
coding problem - JSP-Servlet
coding problem  dear sir will u plz tell me how can we delete a record from the database(MSaccess) when option in the combobox is selected(jsp)  If u want to delete the record from database, by seleting
coding problem - Java Beginners
coding problem  i had a big doubt. public ArrayList readExpenseType() throws ClassNotFoundException, SQLException,Exception { DBConnection dbc = new DBConnection(); Connection con = dbc.getConnection(); ArrayList
coding problem - JSP-Servlet
coding problem  Dear sir i m very new to JSP .I am using two conbobox .if any option is selected in first combobox then only its data from the database should be displayed in other combobox, means how can we refresh
coding problem - Java Beginners
coding problem  hi! i declared date as date datatype in oracle now i need to retrieve date from database to my java code.how can i please help me urgent   Hi Friend, We are providing you a code that will retrieve
Problem in coding - Java Beginners
Problem in coding  How many times do you have to roll a pair of dice before they come up snake eyes? You could do the experiment by rolling the dice... friend, Code to help in solving the problem. public class Stimulates
Please provide coding for following problem
Please provide coding for following problem  Please provide the coding for the following problem: You will write a java program that will read data from a file. The data in the file will be: John Doe 75 Joe Blow 65 Mary Smith 80
Java Coding Problem - Java Beginners
Java Coding Problem  Q.1 How to write a while loop that displays all even numbers till 40? Q.2 How to write a method that accepts an integer parameter and displays the divisors of that integer?  Hi friend
problem in writing coding. Please help me.
problem in writing coding. Please help me.  Hi sir, my name is Logeswaran. I have problem in writing JSP coding for my university assigments. Actually I'm doing a Voting System. I need to know how to write JSP coding
coding problem using vb and access - Security
coding problem using vb and access  i have problem on coding using vb on register button.when i click the label link it will terminate that program.so hard for me.i have no idea. then i also have problem on update,delete and add
problem to do coding upload image in php
problem to do coding upload image in php  can i get example coding how to upload image in php?i have try it but i dont no wheter it is correct or not because i can't save the image in folder and not connected to database mysql
Which one is better for creating a GUI using swings either Manual coding or IDE(NetBeans,eclipse)..? drag and dropping components
swings either Manual coding or IDE(NetBeans,eclipse)..? drag and dropping components...Which one is better for creating a GUI using swings either Manual coding or IDE(NetBeans,eclipse)..? drag and dropping components  I am beginner
NetBeans
NetBeans  why Netbeans IDE is not commonly used Today by most of the companies
Java Programming and Coding problem - Java Beginners
Java Programming and Coding problem  How write a program that helps the user count his change. The program should ask how many quarters the user has, then how many dimes, then how many nickels, then how many pennies
NetBeans
NetBeans  Hi, I am Kundan I have made a project on NetBeans. And now I want to know that how can i run my project without NetBeans IDE,on other PC. Please help me it's important
NetBeans
NetBeans  Hi, I am Kundan I have made a project on NetBeans. And now I want to know that how can i run my project without NetBeans IDE,on other PC. Please help me it's important
netbeans
netbeans  In netbeans, there are choices of books with their price. you check the book you wanted then click the purchase.the output should be the book with the price then you will get the total price of the book you purchase.how
netbeans
netbeans  guysss m nt able to opemn ma netbeans ide.. no error msg s coming... wn i installed yesterday one msg came stating about some run time error... sm one plzzzzzz hlp me
problem in inserting data in databases created in netbeans using jsp..
problem in inserting data in databases created in netbeans using jsp..  i am trying to make a virtual classroom website in jsp using netbeans.i created table inside netbeans through sql editor.and tried to make a login page whose
coding
coding  I need the logout coding. can you please help me.   Please visit the following links: http://www.roseindia.net/quickguide/tomcat/Logout.shtml http://www.roseindia.net/jsp/loginstatus.shtml
program coding
program coding  how to rearrange the array a[1]. . a[n] even elements and odd elements? please give the example coding program.please provide the coding for this problem
webservice in Netbeans
problem at 17 th step while right clicking on the source code im not getting..... im using netbeans version 6.9.1 .. pls help me out... regards-- Harish Kumar
java netbeans
java netbeans  i am making project in core java using Netbeans. Regarding my project i want to know that How to fetch the data from ms-access... using netbeans
java netbeans
java netbeans  i am making project in core java using Netbeans. Regarding my project i want to know that How to fetch the data from ms-access... using netbeans
RMI and netbeans
RMI and netbeans  how to use Rmi in netbeans? i want to connect to a server machine which is holding my application and need to identify the systems connected in LAN with it and get the IP address from it i wnt to use netbeans
netbeans library
netbeans library  Hi could someone build a program in netbeans for a book library please.The program should provide a menu of options to work with the library, including: 1) Adding a new item to the library 2) Viewing all stock
netbeans library
netbeans library  Hi could someone build a program in netbeans for a book library please.The program should provide a menu of options to work with the library, including: 1) Adding a new item to the library 2) Viewing all stock
Netbeans program
Netbeans program  I need to write a program that does the following... The TicTacToe class contains a 3x3 two-dimensional array of integers... a two human player game of Tic-Tac-Toe. Using the NetBeans design tool also create
EJB with NetBeans
EJB with NetBeans  I am very new in Ejb and with very few knowledge about it. I have download NetBeans (7.01) and GlassFish (3.01). But, as I have no idea about Ejb, I am not getting how to run the code which includes a simple
Netbeans Question.
Netbeans Question.   Ok here is my code- * * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.Random; /** * */ public class ContinueRollDie { * @param args
netbeans program
netbeans program  Hi. could someone build this for me in netbeans please :) You are required to create a basic library management system for use with books. A Graphical User Interface (GUI) is not required, i.e. your program
buttons in netbeans,java
buttons in netbeans,java  respected sir, i would like to known how to make coding on a button while working on netbeans, so that a new window will open after clicking on that button? thank you   import java.awt.
Netbeans GUI Ribbon
Netbeans GUI Ribbon  how to create ribbon task in java GUI using netbeans
RMI in netbeans 6.5
RMI in netbeans 6.5  runing client in RMI using netbeans 6.5
coding for project
coding for project  hai how to write jsp coding for project smart accessories ...... that s to navigate to another page when you click on a tag
coding for chart
coding for chart  I want to convert a character into binary then convert it into its diagram in form of digital electrical signals.How can I do java coding for this diagram
Java Coding
Java Coding  Hello, Can u please tel me how to improve my coding techniques.I am feeling difficulty with coding but I am perfect with my theory part
JNDI names in netbeans
JNDI names in netbeans  how to create a JNDI names in netbeans
 

 

 

DMCA.com