java¼¼ÄÜ°ÙÁ¶001 Test
package CH1;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class exercise001 extends JApplet {
// ¶¨Òå±äÁ¿
private JColorChooser chooser = new JColorChooser();
private JButton button = new JButton("Show Color Chooser");
private JDialog dialog;
// ³õʼ»¯³ÌÐò
public void init() {
// ÖÆ×÷½çÃæÈÝÆ÷
Container contentPane = getContentPane();
contentPane.setLayout(new FlowLayout());
contentPane.add(button, BorderLayout.CENTER);
// Ñ¡Ôñ¿ò
chooser.setPreviewPanel(new PreviewPanel());
// ʱ¼ä¼àÌý
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (dialog == null)
dialog = JColorChooser.createDialog(exercise001.this,
"Pick A Color", false, chooser, null, null);
dialog.setVisible(true);
}
});
}
// ÖÆ×÷Ô¤ÀÀÃæ°å
class PreviewPanel extends JPanel {
public PreviewPanel() {
setPreferredSize(new Dimension(0, 100));
setBorder(BorderFactory.createRaisedBevelBorder());
}
public void paintComponent(Graphics g) {
Dimension size = getSize();
g.setColor(getForeground());
g.fillRect(0, 0, size.width, size.height);
}
}
}
Ïà¹ØÎĵµ£º
µ±ÖØÔØequals·½·¨Ê±,×ñѹßÀý.
equals²»ÊÇÿ¸öÀ඼±ØÐëÖØÔØ,µ±ÒÔϼ¸¸öÌõ¼þÂú×ã,¿ÉÒÔ²»ÖØÔØequals.
1. ÀàµÄʵÀýÖ»ÓÐͬһ¸ö²Å±»ÅÐΪÏàµÈ. ÈçThreadÀà.
2. ²»ÓùØÐÄÁ½¸ö¶ÔÏóÊÇ·ñÂß¼ÏàµÈµÄʱºò,»òÊÇ˵±È½Ï¶ÔÏóûÓÐÒâÒå.
3.¸¸ÀàÒѾÖØÔØÁËequals,¶øÇÒ¸¸ÀàµÄequalsÒ²ÊÊÓÃÓÚ×ÓÀà,×ÓÀà¾Í²»ÓÃÖØÔØequals.
4.ÕâÊÇÒ»¸ö˽ÓÐÀà»òÊ ......
ÔÚ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;
½ ......
ÓÃJavaÁ¬½ÓSQL Server2000Êý¾Ý¿âÓжàÖÖ·½·¨£¬ÏÂÃæ½éÉÜÆäÖÐ×î³£ÓõÄÁ½ÖÖ£¨Í¨¹ýJDBCÇý¶¯Á¬½ÓÊý¾Ý¿â£©¡£
1. ͨ¹ýMicrosoftµÄJDBCÇý¶¯Á¬½Ó¡£´ËJDBCÇý¶¯¹²ÓÐÈý¸öÎļþ£¬·Ö±ðÊÇmssqlserver.jar¡¢msutil.jarºÍmsbase.jar£¬¿ÉÒÔµ½Î¢ÈíµÄÍøվȥÏÂÔØ£¨http://www.microsoft.com/downloads/details.aspx?FamilyId=07287B11-0502-461A-B ......
ÏëÔÚ¿ª·¢ÖÐÌá¸ßËٶȺÍЧÂÊ£¡²»ÄÜÍü¼ÇµÄEclipse¿ì½Ý¼ü
Eclipse¿ì½Ý¼ü´óÈ«
ÍƼöCtrl+1 ¿ìËÙÐÞ¸´(×î¾µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌرðʵÓÃ,¿ÉÒÔÊ¡È¥ÏȼôÇÐ,ÔÙÕ³Ìù ......