JAVAͼÐλù´¡
1.×î¼òµ¥µÄͼÐΣ¬Ò»¸öÏûÏ¢¿ò
import javax.swing.JOptionPane;
//±íÃ÷³ÌÐòʹÓÃjavax.swing°üµÄJOptionPaneÀà
public class Dialog1{
public static void main(String[] args) {
// TODO Auto-generated method stub
//Ͼä±íÃ÷³ÌÐòʹÓÃJOptionPaneÀàµÄshowMessageDialog·½·¨1`
JOptionPane.showMessageDialog(null,"welcome to java");
}
}
2.ÈÔÈ»ÊǼòµ¥µÄÏûÏ¢¿ò£¬ÊäÈëÃû×ÖºóÏÔʾ»¶ÓÏûÏ¢
import javax.swing.JOptionPane;
public class NameDialog{
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String name=
JOptionPane.showInputDialog("what is your name? ");
String message=
String.format("welcome,%s,to java programming! ",name);
JOptionPane.showMessageDialog(null,message);
}
}
3.ÒÔÉÏÁ½¸öÀý×ÓµÄÔËÓã¬Á½¸öÕûÊýºÍµÄÊä³ö£¬×¢ÒâInteger.parseInt()ÓÃÓÚ½«×Ö·û´®×ª»¯ÎªÕûÊý
import javax.swing.JOptionPane;
public class ShowAdd{
public static void main(String[] args) {
// TODO Auto-generated method stub
int integer1;
int integer2;
String firstNumber=
JOptionPane.showInputDialog("ÇëÊäÈëµÚÒ»¸öÕûÊý£º ");
String secondNumber=
JOptionPane.showInputDialog("ÇëÊäÈëµÚ¶þ¸öÕûÊý£º ");
integer1=Integer.parseInt(firstNumber);
integer2=Integer.parseInt(secondNumber);
String Sum=
String.format("%dºÍ%dµÄºÍΪ£º%d ",integer1,integer2,integer1+integer2);
JOptionPane.showMessageDialog(null,Sum);
}
}
3.ÔÚ¿òÀïÃæ³öÏÖÁ½Ìõ¶Ô½ÇÖ±Ïß
import java.awt.*;
import javax.swing.*;
public class DrawPanel extends JPanel
{
Ïà¹ØÎĵµ£º
ͨ¹ý DAOFactory µÄ·ºÐÍд·¨À´ÑÝʾJava·ºÐ͵ÄÌØÊâÓ÷¨
СÐÍÏîÄ¿Öг£³£¶¼Ã»ÓÐÓÃÈý·½³Ö¾Ã»¯¿ò¼Ü£¬¶ø´ó¶¼ÊÇÓù«Ë¾»ò×ÔÐÐÒÀ¾ÝDAOģʽ·â×°µÄһЩ×é¼þÀ´Íê³ÉÊý¾Ý¿â³Ö¾Ã»¯¶¯×÷£¬²¢ÇÒ£¬Í¨³£ÎªÁ˸ü¾ß¿ÉÀ©Õ¹ÐÔ£¬³£³£Ê¹ÓóéÏ󹤳§Ä£Ê½À´½âñîºÏ¡£
Ò»¡¢ÏÈ¿´´úÂë
1¡¢¼òµ¥¹¤³§´úÂë
/************************************************* ......
±àÕß°´£ºÔçÔÚÉÏÊÀ¼Í90Äê´ú£¬¸÷ÖÖ¹ØÓÚJavaÒÑËÀµÄ¶ÏÑÔ¾ÍÒѾ¿ªÊ¼³öÏÖ¡£Ê®¶àÄêÖ®ºóµÄ½ñÄ꣬ÕâÑùµÄÑÔÂÛÒÀÈ»²»¾øÓÚ¶ú¡£ÒԹؼü´Ê"java is dead"ÔÚGoogleÖÐËÑË÷£¬µÃµ½´óÔ¼199,000Ìõ½á¹û£¬Óɴ˿ɼû²»ÉÙÈËд¹ý»òÆÀÂÛ¹ýJavaµÄËÀÍö¡£Õë¶ÔÕâÃÅÒÑËÀÊ®¶àÄêµÄÓïÑÔ£¬×÷ÕßÔÚÎÄÖиÅÊöÁ˵±½ñJavaµÄµØλ¼°Æä·¢Õ¹Ç÷ÊÆ£¬ÓÐÁ¦µØ»Ø»÷ÁËÕâЩ´«ÑÔ¡£È«Î ......
package reflect;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Test {
public static void main(String[] args) {
try {
Class c = Class.forName("reflect.Student");// ¸ù¾ÝÀàµÄÍêÕûÀàÃû´´½¨ÀàÏó
  ......
ʵÏÖ²½Ö裺
1.×Ô¶¨ÒåÒ»¸öJavaÀ࣬¸ÃJavaÀàÖж¨ÒåÒ»¸ö·½·¨À´°üº¬ÐèÒª±»ÔËÐеĴúÂë¡£
2.¶¯Ì¬±àÒë¸Õ¸ÕÉú³ÉµÄJavaÔ´Â룬²»ÔÚ´ÅÅÌÉÏÉú³ÉÔ´Â룬¶øÊÇÖ±½Ó±àÒëÄÚ´æÖеÄJavaÔ´Âë¡£
3.¶¯Ì¬¼ÓÔظոմ´½¨±àÒëµÄJava¶þ½øÖÆÂ룬±àÒëºÃµÄJava¶þ½øÖÆÂë²»ÊÇÔÚ´ÅÅÌÉÏ£¬¶øÊÇ·ÅÔÚÄÚ´æÖУ¬²¢¶¨Òå×Ô¼ºµÄÀà¼ÓÔØÆ÷£¬¸ºÔð¼ÓÔØÄÚ´æÖеÄclassÎļþ¡£
......
package cn.vicky.reg;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class MyEclipseReg {
// ///////////////////////////////////////////////////////////
// ÔËÐиÃÎļþ ÊäÈëÓû§Ãû µã»÷»Ø³µ¼´¿ÉÉú³É MyEclipse 6.0 ºÍ 7.0 ͨÓû§×¢²áÂë
// ///// ......