io ho fatto così
codice:
/**
*
*/
package gccbClient;
import gccb.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
/**
* @(#)FrameAccredito.java
*
*
* @author Raffaella Rotunno
* @version 1.00 2007/4/24
*/
public class CCAppletClient extends JApplet {
public static final int PORT = 6502;
InetAddress addr = null;
Socket socket = null;
String serverName = null;
public void init() {
try {
serverName = this.getParameter("server");
} catch (NullPointerException exc) {
System.out.println("Using localhost as server");
}
try {
addr = InetAddress.getByName(serverName);
} catch (UnknownHostException exc) {
status.setText("ERRORE: Host sconosciuto, " +
"impossibile continuare");
}
FrameChooseOption f = new FrameChooseOption();
try {
socket = new Socket(addr, PORT);
BufferedReader in = new BufferedReader(
new InputStreamReader(
socket.getInputStream()));
PrintWriter out = new PrintWriter(
new BufferedWriter(
new OutputStreamWriter(
socket.getOutputStream())),true);
} catch (ConnectException exc) {
status.setText("ERRORE: Server non attivo/Connessione "+
"rifiutata");
} catch (IOException exc) {
status.setText("Errore di I/O");
} finally {
try {socket.close();}
catch (IOException exc) {}
catch (NullPointerException exc) {}
}
}
public static void main(String[] args) {
JApplet applet = new CCAppletClient();
JFrame frame = new JFrame("Conto Corrente - Applet Client");
// Gestisce l'evento di chiusura
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.getContentPane().add(applet);
frame.setSize(300,110);
applet.init();
applet.start();
frame.setVisible(true);
}
}
solo ke il form giustamente non è all'interno della pagina ma i vari frami escono come finestre separate dalla pagina web
se io volessi invece incorporarla nella pagina web come dovrei fare?