473,659 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please:need a urgent help

hirak1984
316 Contributor
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 1148
horace1
1,510 Recognized Expert Top Contributor
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 MVP
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 Contributor
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
1427
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 = 'Dani'). the problem is that i don't understanh how the ViewRowState works: i have an external form that changes the value of the dataTable.
3
1240
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 this metho ------------------ Sub cute(sender As Object, e As EventArgs Response.Write(ddlColors.SelectedItem.text End Su ------------------
0
1344
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 Public First As String Public Last As String End Structure
17
2280
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 scripts. each when clicked i am able to run the script. so HOW and what do i do to call and run the .sql Thanks
0
963
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 panel index i am not getting the content name . so plese tell me how can i get this . My code is private void showhelp(string currentpage)
0
7420
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 Thanks in Advance Balamurugan Ranganathan
6
3310
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, EmpName,DeptID,DateOfJoin, Sal, Addr) Finance (EmpID, Sal) Club (Clubname, EmpID, Fee, DateOfJoin) Leave (EmpID, Date) Department (DeptID, DeptName, NoOfEmployees)...
1
4379
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 for this query: SELECT DISTINCT oeh.ORDER_NUMBER AS sales_order_number, oeh.REQUEST_DATE AS CUST_REQ_DATE,
3
1589
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 pops up. "The email address you entered already exists." Now my problem is i am not able to find out the where the error is generating or why as the datdabase table is completely empty (no records) Below is the code... ++++++++++++++++++ <%
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8525
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
7356
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...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
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();...
1
2750
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.