*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A Question on JTabbedPanes" Watch "A Question on JTabbedPanes" New topic
Author

A Question on JTabbedPanes

John Charney
Greenhorn

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\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

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: http://aspose.com/file-tools
 
subject: A Question on JTabbedPanes
 
Similar Threads
how to round rectangle in jtabbedpane?
change Border color of JTAbbedPane and selection of TabbedPane..Plz solve Problem
A confused new user of Java that needs some help
Help i need help with borderlayout
A confused new user of Java that needs some help