Solved

interface expected here

Posted on 2002-05-10
6
580 Views
Last Modified: 2006-11-17
hi All,

Do you know what's the pb here? I would be checking this post frequebtly ... Thanks.

---------------- JDK Release Build ------------------
Compiling C:\WebDesign(Dev)\Pos_Test\PrintReceipt.java
C:\WebDesign(Dev)\Pos_Test\PrintReceipt.java:12: interface expected here
public class PrintReceipt extends JFrame implements JApplet

Dawn.
0
Comment
Question by:Dawn_rico
  • 3
  • 3
6 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 50 total points
ID: 7000678
 JApplet is a class and not an interface. You cannot implement a class but you only implement the interface. You have to change your code: public class PrintReceipt extends JFrame implements JApplet to public class PrintReceipt extends JApplet and it will work. The JApplet itself extends java.awt.Panel and you can use it as you would use a JFrame.

  Hope it helps.
0
 

Author Comment

by:Dawn_rico
ID: 7000953
hi girionis ,

Thanks for your immediate detailed explanation.

frame.pack();
setTitle("Point of Sales - Receipt");

Some other doubts - for applets, am I not suppose to use these 2 methods?

Thanks.

Dawn.
0
 
LVL 35

Expert Comment

by:girionis
ID: 7001071
 You cannot use the pack() method with a JApplet. pack() is inherited from java.awt.Window and since JApplet does not extend it you cannot use it. You could always write yor own though if you feel it is necessary. If you want to set a size for your applet you can use the resize(int, int) or resize(Dimension).

  As for the title, you cannot set the title of the whole window since the applet is running within a browser and it would require you to change the title of the browser. If you want to set a title to your applet window only pass it through the parameters in the HTMl file: <param name="title" value="WStar Applet by Propix">

  Hope it helps.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:Dawn_rico
ID: 7001258
hi girionis ,

:) Thanks a lot for your extra very detailed help ! You're very good in Java ..

Dawn.
0
 

Author Comment

by:Dawn_rico
ID: 7001263
hi girionis ,

:) Thanks a lot for your extra very detailed help ! You're very good in Java ..

Dawn.
0
 
LVL 35

Expert Comment

by:girionis
ID: 7001352
 Thank you for the points. :-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet filter example 37 85
Eclipse Help Java EE 5,6,7 Documentation, why not Java EE 8 8 47
java mysql insert application 14 47
restrict decimal places for double datatype 10 34
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question