• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A Question on JTabbedPanes

 
John Charney
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there. I a a new student to the Java Language (I am actually taking a Java programming class this summer) anyways I have to design a program using a JTabbedPane providing one tab to input user data such as the name and address of a person and another tab to input information about a pizza order.The teacher would like us to be somewhat creative and be able to change the naem and address once it is able to be viewed to different colors and such The program just has to echo the data submitted. Here is the code that I have been able to come up with so far:

When I compile this code I come up with the 3 error messages:
C:\$jg105\Tabs.java:38: Invalid method declaration; return type required.
public SelectName() {
^
C:\$jg105\Tabs.java:15: Class SelectName not found.
SelectName name = new SelectName();
^
C:\$jg105\Tabs.java:15: Class SelectName not found.
SelectName name = new SelectName();
^
3 errors
Finished
Can anyone tell me what am I doing wrong here. IT is probably a simple mistake but still one that I have yet to figure out where it is. Also how will I go about taking in the users input for their name and address for the first tab and the pizza order info for the second tab? I am still puzzeled on how to appraoch that part. Any help is much appreaicated. Thanks alot
(edited by Cindy to format code)

[This message has been edited by Cindy Glass (edited July 24, 2001).]
 
Lucas Richardson
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It gives the first error because SelectName() has no return type. Since it doesn't return anything, just add "void" to the start of the line. The other two errors occur because you're trying to create an instance of the class SelectName, but it isn't a class. You do, however, have a class named Name, which looks like is what you wanted to use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic