File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes A Question on JTabbedPanes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A Question on JTabbedPanes" Watch "A Question on JTabbedPanes" New topic

A Question on JTabbedPanes

John Charney

Joined: Jul 23, 2001
Posts: 3
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\ Invalid method declaration; return type required.
public SelectName() {
C:\$jg105\ Class SelectName not found.
SelectName name = new SelectName();
C:\$jg105\ Class SelectName not found.
SelectName name = new SelectName();
3 errors
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

Joined: Jul 08, 2001
Posts: 32
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.
I agree. Here's the link:
subject: A Question on JTabbedPanes
It's not a secret anymore!