This feels like a really simple question, however, in every instance that I've looked for and found an "answer" it was far beyond my level of comprehension. I'm relatively new to Java, only having started back in September for my A.P. Comp Sci class. However, I am making a very simple applet to ask a (similarly nerdy) girl to prom. So basically this means that I need the applet to work just by being on the flash drive which I will give to her. I've never needed to export before and my program runs fine (at least from Eclipse's standpoint), however, every time I export it as a .jar file and try to run it, nothing happens. At all. No error, no box, nothing. I keep seeing that I need to use html's or something which seems a bit overwhelming and not within the options (as I said, considering it needs to work just by plugging the drive into any computer).
Anyway, how can I fix this and win over my potential date?
Code as follows:
package Runner;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class mainRunner extends Applet implements ActionListener {
public mainRunner(){
Label Prom=new Label ("Prom?");
JButton BYes=new JButton("Yes!");
JButton BNo=new JButton("No!");
JButton YYes=new JButton("Why yes?");
JButton YNo=new JButton("Why no?");
BYes.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent Yes){
//code...//
}
}
);
BNo.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent No){
//code...//
}
}
);
YYes.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent WhyYes){
//code...//
}
}
);
YNo.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent WhyNo){
//code...//
}
}
);
add(Prom);
add(BYes);
add(YYes);
add(BNo);
add(YNo);
}
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
}
}
Thanks in advance and try to keep things pretty streamlined if possible.