473,414 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Please:need a urgent help

hirak1984
316 100+
When i am calling this class from another class only a blank frame appears,with nothing on it.I dont know where the problem is,Please help.
Expand|Select|Wrap|Line Numbers
  1.  class project extends JFrame{ 
  2. public void project() {
  3. //JFrame frame=new JFrame();
  4.   jtf = new JTextField(3);
  5.   jtf1 = new JTextField(15);
  6.   JPanel p1 = new JPanel();
  7.   p1.add(new JLabel("SID"));
  8.   p1.add(jtf);
  9.   p1.add(new JLabel("User name:"));
  10.   p1.add(jtf1);
  11.   p1.add(new JLabel("Password:"));
  12.   p1.add(pass);
  13.   p1.setSize(200,200);
  14.   this.getContentPane().add(p1);
  15.   JButton submit = new JButton("SUBMIT");
  16.   submit.setActionCommand("submit");
  17.   submit.addActionListener(this);
  18.  
  19.   JButton reset = new JButton("RESET");
  20.   reset.setActionCommand("reset");
  21.   reset.addActionListener(this);
  22.  
  23.   JPanel p2 = new JPanel();
  24.   p2.add(submit);
  25.  
  26.   p2.add(reset);
  27.   //contentPane.add("Center", p2);
  28.   //p2.setSize(200,200);
  29.   this.setVisible(true);
  30.   this.setVisible(true);
  31.   this.getContentPane().add(p2);
  32.   this.setSize(500,500);
  33.   this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  34.  
  35.  }
  36. }
  37.  
Jan 30 '07 #1
3 1139
horace1
1,510 Expert 1GB
I assume the project() method is a constructor?
Expand|Select|Wrap|Line Numbers
  1. public void project() {
  2.  
if so it should not have a return type, e.g.
Expand|Select|Wrap|Line Numbers
  1. public project() {
it may then appear when you create a new project();
Jan 30 '07 #2
r035198x
13,262 8TB
I assume the project() method is a constructor?
Expand|Select|Wrap|Line Numbers
  1. public void project() {
  2.  
if so it should not have a return type, e.g.
Expand|Select|Wrap|Line Numbers
  1. public project() {
it may then appear when you create a new project();
Make it a habit to name your classes starting with a capital Letter e.g
Expand|Select|Wrap|Line Numbers
  1. class Project
and your methods should begin with a small letter. horace1 is right. Constructors do not have a return type (void is a return type). Read the Java classes in this forum.
Jan 30 '07 #3
hirak1984
316 100+
Hey buddies it worked!!!!!!!!!!!!11
i only removed "void" from the constructor.
thanks for all the pain u took to read my code and figure out the error.
This is why thescripts is the best of its kind on the net.


Make it a habit to name your classes starting with a capital Letter e.g
Expand|Select|Wrap|Line Numbers
  1. class Project
and your methods should begin with a small letter. horace1 is right. Constructors do not have a return type (void is a return type). Read the Java classes in this forum.
Jan 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Ubi | last post by:
hi i have a problem with System.Data.DataViewRowState. i have a ReadOnly datagrid, a dataView and a dataTable. i'm using the dataView's filter property to filter the data (firstName =...
3
by: Bilal | last post by:
hi all I am facing a little problem. I have a form with a dropdownlist control. I have a button and when i click the form posts back The problem is that in the on button click event i'm calling...
0
by: Miguel Dias Moura | last post by:
Hello, I am working on an Asp.Net 2.0 / SQL 2005 web site. I am using profile to save the users info on the database. For example, I have the following structure: Public Structure Name...
17
by: Saps | last post by:
Hi all. Can anyone help me here. I have loads of .sql files and i need a way to call these from my asp page so the user can run them from the browser. Meaning i have a page with a list of all...
0
by: lvishnugoud | last post by:
Hi, Please Help me for solve this problem. Actually i am create ing help (.chm) files by using HelpNavigator enumrator and showhelp method. I am getting result but in help file left...
0
by: Balamurugan Ranganathan | last post by:
I want to calculate the execution time of a sql query through C#.net this is to analysis two queries to compare their execution time it is very Urgent Please help me Please help Me ...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
1
by: veerunrt | last post by:
Hi All, one column is having no of values separated by comma in the table that any one value should match with some other column of another table one value how to join in oracle I need result...
3
by: jats | last post by:
I am a .NET programmer and i had recently got a web application designed in Classic ASP, to make some modifications. When i run the application and try to create a new user the following error...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...

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.