• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1011
  • Last Modified:

Java applet runing SmartCard Reader


First of all, sorry for my bad english, I will try my best....

I´m developping an application with Java, an Applet that read the smart card an authorize the connection throw a website.

My problem is, at the Eclipse IDE the applet works and read the smart card connected, but when I export generating a simple jar, and open it at the browser, it won´t run, even if I create a JDialog panel only to show something, below is the code I´m using.

Thanks a lot!

public class SignerPje extends JApplet  {

	private static final long serialVersionUID = 1L;
	private JTextField rows = new JTextField("3"), cols = new JTextField("3");
	public void init() {
		JPanel p = new JPanel();
	    p.setLayout(new GridLayout(2,2));
	    p.add(new JLabel("Rows", JLabel.CENTER));
	    p.add(new JLabel("Columns", JLabel.CENTER));
	    Container cp = getContentPane();
	    cp.add(p, BorderLayout.NORTH);
	    JButton b = new JButton("go");
	    cp.add(b, BorderLayout.SOUTH);

Open in new window

  • 4
  • 2
1 Solution
You have to run the applet in browser in different way. You have to create an html page and then the applet will run in browser.
Please follow this link:
RodrigoferraAuthor Commented:
Hello @Valeri, I did it, with this code:

<object type="application/x-java-applet;version=1.4.1" width="500" height="500" name="pjeSignerObjects" id="pjeSignerObjects" style="position: absolute; top: -100px;">
	<param name="archive" value="appTestePjeCa2.jar" />
	<param name="code" value="br.com.pol.main.SignerPje" />

Open in new window

The problem is, the applet is not executing, I heard something about sign the applet and then it will be able to run files from the client. Is that correct?

you should use "applet" tag, not "object"
try this:

<applet code="br.com.pol.main.SignerPje.class"
        width="120" height="120">
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I tested your applet with this html and it works on my PC :

 <p> This file launches the PJE applet!</p>  
<applet code="data.SignerPje.class" archive="test.jar"
        width="400" height="300">
No Applet

the jar file and the html file are in one and the same folder. you have to change the package name in "code" and the jar name in "archive".
RodrigoferraAuthor Commented:
Hello, thanks again!

I think that exist some cache, because it is not runing, do you know any issue related to it?
I think it's not because of cache...
If you use windows, next to the clock /at the right bottom/ of desktop should exists java icon. right click on it and open the java console. in case there are some errors you should be able ot fix them by tracing the stack traces on the console.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now