|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: May 2001
Città: Sunnydale
Messaggi: 5139
|
[Java/applet] Trasformazione in Applet
Chi mi può aiutare/ dare suggerimenti/ dire cosa modificare per trasformare questo codice in applet java inseribile in una pagina html con tag <APPLET CODE=miaAppplet.class> ?
Codice:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class prova extends JFrame {
String[] opzioni = {
"opzione5", ""opzione1", "opzione2",
"opzione3", "opzione4"
};
JComboBox cbox;
prova() {
setTitle("prova: test applet ");
getContentPane().setLayout(new BorderLayout()); // layout manager
cbox = new JComboBox(opzioni);
getContentPane().add(cbox, BorderLayout.WEST);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(400, 300);
setVisible(true);
}
public static void main(String args[]) {
new prova();
}
}
Codice:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class prova1 extends JFrame {
prova1() {
setTitle("uhmmm (vuoto)");
getContentPane().setLayout(new BorderLayout()); // layout manager
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(400, 300);
setVisible(true);
}
public static void main(String args[]) {
new prova1();
}
}
__________________
"Fear is the path to the dark side... fear leads to anger... anger leads to hate... hate leads to suffering." Ultima modifica di X-ICEMAN : 24-01-2008 alle 01:28. |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 01:20.



















