Solved

interface expected here

Posted on 2002-05-10
6
586 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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 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:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

696 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