Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

interface expected here

Posted on 2002-05-10
6
Medium Priority
?
595 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 200 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
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…
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 the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

618 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