博文

JAVA C/S 考试模拟系统源代码(客户端)(2006-08-24 22:16:00)

摘要:  TestPanel.java package ClientPart;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.net.*; public class TestPanel extends JPanel implements ActionListener,Runnable{
 private Socket connectToServer;
 private DataInputStream inFromServer;
 private DataOutputStream outToServer;
 private Thread thread;
 
 private Timer testTimer;
 private int testTime;
 
 private JButton startButton;
 private JLabel timeLabel;
 private JTextArea questionArea;
 private Checkbox radioButton[] = new Checkbox[4];
 private CheckboxGroup buttonGroup = new CheckboxGroup();
 private JButton answerButton;
 private JButton questionButton;
 private JButton scoreButton;
 public TestPanel(InetAddress add,int port){
  initPanelGUI();
  try{
   connectToServer = new Socket(......

阅读全文(8134) | 评论:3

JAVA C/S 考试模拟系统源代码(服务器端)(2006-08-24 22:15:00)

摘要:ServerThread.java package ServerPart;
import java.io.*;
import java.net.*;
import java.util.*; public class ServerThread {  private Socket connectToClient;
 private DataOutputStream outToClient;
 private DataInputStream inFromClient;
 private ReadTestFile readTestFile;
 private String selectedAnswer = "";
 
 public ServerThread(Socket socket){
  connectToClient = socket;
  try{
   readTestFile = new ReadTestFile();
   inFromClient = new DataInputStream(connectToClient.getInputStream());
   outToClient = new DataOutputStream(connectToClient.getOutputStream());
  }
  catch(IOException e){
   
  }
  //start();
 }
 
 private void socketClosing(){
  try{
   inFromClient.close();
   outToClient.close();
&n......

阅读全文(7960) | 评论:4

完整的初始化过程(2006-05-29 21:10:00)

摘要:今天起,日志开辟专栏,将专业学习的一些知识点记录下来。用BLOG记录似乎更加方便一些,权且当作学习笔记吧。 完整的初始化过程。 例:
class con1{     public con1()
    {
          System.out.println("1");
    } } class con2 extends con1{
     String x="hello";
     public con2()
     {
          System.out.println("2");
          tt();
     }
     public void tt()
     {
          System.out.println("a"+x);
     }
} class con3 extends con2{
     String x="hi";
     public con3()
     {
          System.out.println("4");
 &nbs......

阅读全文(4784) | 评论:0