Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java GUI

Ò»¡¢BorderLayoutTest.java
package com.briup.md08;
import java.awt.*;
import javax.swing.*;
/*BorderLayoutÌصã
1¡¢×é¼þµÄ´óСÓÉÈÝÆ÷¾ö¶¨
2¡¢ÈÝÆ÷±»»®·ÖΪ5¸öÇøÓò£¬Ã¿¸öÇøÓòÖ»ÄÜÖ±½Ó¼ÓÈë3¸ö×é¼þ
3¡¢×é¼þ¼ÓÈëµÄλÖÃÐèÒªÖ¸¶¨£¬Ä¬ÈÏΪCENTER
4¡¢×é¼þÖ®¼äĬÈÏûÓмä϶
5¡¢Èç¹û³ýCENTER ÒÔÍâµÄÇøÓòûÓмÓÈë×é¼þ£¬Æä¿Õ¼ä½«±»ÆäËûÇøÓòºÏÀí·ÖÅ䣻Èç¹ûCENTERÇøÓòûÓмÓÈë×é¼þ£¬Æä¿Õ¼ä½«»á±£Áô£»Í¨³£ÔÚʹÓÃÖбØÐëÔÚCENTER¼ÓÈë×é¼þ£¬ÆäËüÇøÓò¿ÉÒÔÊÓÐèÒª¾ö¶¨
ÒªÇ󣺱£³ÖÈÝÆ÷´óСΪ800*600£¬½«FlowLayoutTestÖÐ100¸öJButton·Åµ½CENTERÇøÓò£¨Ã¿¸ö°´Å¥´óСÏàͬ£¬Ã¿ÐÐ10¸ö°´Å¥£©
*/
public class BorderLayoutTest{
 private JFrame f;
 private Container c;
 private JPanel jp;
 public BorderLayoutTest(){
  f=new JFrame("Border Layout");
  c=f.getContentPane();
  c.setLayout(new BorderLayout(10,10));
  /*Ìí¼Ó×é¼þ£ºadd£¨×é¼þ£¬Ìí¼ÓλÖã©*/
  JPanel jp=new JPanel();
  jp.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
  for(int i=1;i<=100;i++){
   if(i<10)
   jp.add(new JButton("00"+i));
   else if(i<100)
   jp.add(new JButton("0"+i));
   else
   jp.add(new JButton(""+i));
  }
  c.add(new JButton("1"),BorderLayout.EAST);
  c.add(new JButton("2"),BorderLayout.WEST);
  c.add(new JButton("3"),BorderLayout.NORTH);
  c.add(new JButton("4"),BorderLayout.SOUTH);
  c.add(jp,BorderLayout.CENTER);
  f.addWindowListener(new WindowClose());
  c.setBackground(Color.red);
  f.setSize(800,600);
  f.setVisible(true);
 }
 public static void main(String[] args){
  new BorderLayoutTest();
 }
 }
¶þ¡¢CardLayoutTest.java
package com.briup.md08;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
/*CardLayoutµÄÌصã
1¡¢ÈÝÆ÷°´ÕÕ¼ÓÈëµÄÏȺó˳Ðò¹ÜÀíÿÕÅ¿¨Æ¬£¬ÏȼÓÈëµÄÔÚÇ°
2¡¢¿¨Æ¬


Ïà¹ØÎĵµ£º

Effective Java ѧϰ±Ê¼Ç(4)

Õâ¸öÔ­ÔòºÜ¼òµ¥£¬¾ÍÊÇʹÓÃ˽Óй¹Ô캯Êý·ÀÖ¹À౻ʵÀý»¯¡£
ÓÐʱ£¬ÎÒÃÇ»áдһЩ¹¤¾ßÀ࣬Èçjava.lang.Math »òÊÇ java.util.Arrays, ÕâЩÀàÖж¼ÊǾ²Ì¬º¯Êý£¬ÔÚÉè¼ÆµÄʱºò£¬ÕâЩÀಢ²»ÊÇÓÃÀ´±»ÊµÀý»¯µÄ¡£Õâ¸öʱºò£¬¾ÍºÜÓбØÒª°Ñ¹¹Ô캯Êý˽Óл¯¡£
public class UtilityClass {
private UtilityClass() {
throw new Assertion ......

Java·ºÐÍ·½·¨

package PairTestMyCode.copy;
import java.util.*;
public class PairTest2
{
public static void main(String[] args)
{
GregorianCalendar[] birthdays =
{
new GregorianCalendar(1906, Calendar.DECEMBER, 9), // G. Hopper
new GregorianCalendar(1815, Cal ......

Java»ñÈ¡ÕæʵIPµØÖ·

ÔÚJSPÀ»ñÈ¡¿Í»§¶ËµÄIPµØÖ·µÄ·½·¨ÊÇ£ºrequest.getRemoteAddr()£¬ÕâÖÖ·½·¨Ôڴ󲿷ÖÇé¿ö϶¼ÊÇÓÐЧµÄ¡£µ«ÊÇÔÚͨ¹ýÁËApache,SquidµÈ·´Ïò´úÀíÈí¼þ¾Í²»ÄÜ»ñÈ¡µ½¿Í»§¶ËµÄÕæʵIPµØÖ·ÁË¡£
Èç¹ûʹÓÃÁË·´Ïò´úÀíÈí¼þ£¬½«http://192.168.1.110:2046/ µÄURL·´Ïò´úÀíΪhttp://www.xxx.com/ µÄURLʱ£¬ÓÃrequest.getRemoteAddr()·½·¨»ñÈ¡ ......

weka1:ÔÚeclipseÏÂʹÓÃjavaµ÷ÓÃweka

ÔÚjavaÏîÄ¿Öе¼Èëweka.jarµÄ°ü,È»ºó°ÑÏÂÃæ´úÂëcopyµ½mainÀïÃæ,
ÓÃeclipseµÄ»°×Ô¶¯import°É.
×¢ÒâÒ»ÏÂÄǸöÎļþµÄ·¾¶ÊÇ·ñÕýÈ·.
import
java.io.File;
import
weka.classifiers.Classifier;
import
weka.classifiers.trees.J48;
import
weka.core.Instances;
import
weka.core.converters.ArffLoader;

½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ