Solved

interface expected here

Posted on 2002-05-10
6
562 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is the latest versions eclipse neon 2 140
Java JRE greater than 1.6 5 50
javap bin 2 29
how to add new optional parameter to JSP 1 29
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now