Time of Update: 2018-12-05
import java.io.File;import java.io.IOException;import java.util.Scanner;import javax.swing.JFileChooser;import javax.swing.JFrame;import javax.swing.JTextArea;public class DisplayFile { /** * @param args */ public static
Time of Update: 2018-12-05
import java.awt.BorderLayout;import javax.swing.JPanel;import javax.swing.JFrame;import java.awt.Dimension;import javax.swing.JTextField;import java.awt.Rectangle;import java.io.BufferedReader;import java.io.File;import java.io.FileReader;import
Time of Update: 2018-12-05
import javax.swing.SwingUtilities;import java.awt.BorderLayout;import javax.swing.JPanel;import javax.swing.JFrame;import java.awt.Dimension;import javax.swing.JButton;import java.awt.Rectangle;import javax.swing.JList;import
Time of Update: 2018-12-05
/** * java版本的escape和 unescape[對應javaScript裡的函數] */public class EscapeTool { public static String escape(String src) { int i; char j; StringBuffer tmp = new StringBuffer(); tmp.ensureCapacity(src.length() * 6);
Time of Update: 2018-12-05
import javax.swing.SwingUtilities;import java.awt.BorderLayout;import javax.swing.JPanel;import javax.swing.JFrame;import java.awt.Dimension;import javax.swing.JLabel;import java.awt.Rectangle;import javax.swing.JTextField;import javax.swing.JButton;
Time of Update: 2018-12-05
import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import javax.swing.JOptionPane;public class testdb {public static String connect(String uid,String
Time of Update: 2018-12-05
import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import javax.swing.JOptionPane;public class DBConnected { static PreparedStatement psmt; static
Time of Update: 2018-12-05
import javax.swing.SwingUtilities;import java.awt.BorderLayout;import javax.swing.JComponent;import javax.swing.JOptionPane;import javax.swing.JPanel;import javax.swing.JFrame;import javax.swing.JLabel;import java.awt.HeadlessException;import
Time of Update: 2018-12-05
import java.awt.*;import java.awt.event.*;import java.io.*;import java.net.*;public class ChatClient extends Frame { Socket s = null; DataOutputStream dos =null; TextField tfTxt = new TextField(); TextArea taContent = new TextArea(); public static
Time of Update: 2018-12-05
import java.io.*;import java.net.*;public class ChatServer { public static void main(String[] args) { boolean started =false; ServerSocket ss =null; Socket s=null; try { ss = new ServerSocket(8888); }catch (IOException e)
Time of Update: 2018-12-05
public class Marquee { int[][] matrix; int n ; //走過的步數 int time;//控制結束的一個參數 int rank ; //階 coordinate start;//起始點 public static void main(String[] s) { a ma = new a(12,new coordinate(0,0) ); coordinate temp = ma.start; while(true)
Time of Update: 2018-12-05
本文主要給出一個實用的java 串口通訊程式,供大家討論學習./****************************************** * 程式檔案名稱:SendComm.java * 功能:從串列口COM1中發送資料 ******************************************/ import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import
Time of Update: 2018-12-05
import javax.swing.SwingUtilities;import java.awt.BorderLayout;import javax.swing.JPanel;import javax.swing.JFrame;public class aaa extends JFrame { private static final long serialVersionUID = 1L; private JPanel jContentPane = null; /** * @param
Time of Update: 2018-12-05
一.基礎1.wtk2.MIDP3.MIDlet4.MIDlet Suite5.jar jad6.JAM AMS7.應用程式管理器的兩種管理方式。8.MIDP1.0 MIDP2.09.Manifest File資訊清單檔(Manifest.mf)10.MIDP Execution Environment MIDP執行環境11.CLDC12.Optional Package 可選包13.功能與資源14.Configuration(CLDC,CDC)--Profile(MIDP,......)15.
Time of Update: 2018-12-05
public class InvertIpAddressCod implements IpAddressInvert { public void invertIpAddress(String ip) { int a=ip.indexOf("."); int b=ip.indexOf(".",a+1); int c=ip.lastIndexOf("."); //System.out.println(a+" "+b+" "+c); String s1,s2,s3
Time of Update: 2018-12-05
import java.applet.*;import java.awt.*;import java.awt.image.*; @SuppressWarnings("serial")public class ChangeImageColor extends Applet { /** 灰階變換的演算法其實很簡單,只要提取每個象素點的紅、綠、藍三原色,然後根據公式:灰階值= 紅色亮度值*30%+綠色亮 度值*59%+藍色亮度值*11%,計算出一個灰階值,並將其作為
Time of Update: 2018-12-05
Java中使用DirectDraw注釋:DirectDraw是微軟DirectX SDK的一個組成部分。Java版的DirectX包含在Java 2.0 SDK中。Java中通過同DirectX一起安裝的com.ms.directX包中的一套類訪問DirectDraw。介紹本文將探討用於Java的DirectDraw
Time of Update: 2018-12-05
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {System.out.println("before calling " method);method.invoke(sub,args);System.out.println("after calling " method);return
Time of Update: 2018-12-05
核心提示:建立一個 Thread Pool Executor 建立一個ThreadPoolExecutor是很簡單的。你只需調用CustomThreadPoolExecutor類構造器並傳輸恰當的配置參數。以下程式碼片段是通過定義核心 線程 數和線程最大數的相同值來建立一個固定尺寸的線程池: private ThreadPoolExecut 建立一個Thread Pool
Time of Update: 2018-12-05
當 Executor 已經關閉,並且 Executor 將有限邊界用於最大線程和工作隊列容量,且已經飽和時,在方法 execute(java.lang.Runnable) 中提交的新任務將被拒絕。在以上兩種情況下,execute 方法都將調用其 RejectedExecutionHandler 的 RejectedExecutionHandler.rejectedExecution(java.lang.Runnable,