Java, Java,: Java Java ; JFrame ; JApplet ; Java, ; I/ O TCP/ IP Socket,,,,,,,: ,,,,;,, ( CIP) Java /,,. :, 2005.

Size: px
Start display at page:

Download "Java, Java,: Java Java ; JFrame ; JApplet ; Java, ; I/ O TCP/ IP Socket,,,,,,,: 010-62782989 13501256678 13801310933,,,,;,, ( CIP) Java /,,. :, 2005."

Transcription

1

2 Java, Java,: Java Java ; JFrame ; JApplet ; Java, ; I/ O TCP/ IP Socket,,,,,,,: ,,,,;,, ( CIP) Java /,,. :, (21. ) ISBN J.. Java - - : -. T P312 CIP (2005 ) : : ht tp :// : : : : : : : : : 14 : 287 : : ISBN / T P7131 : : 20.00

3 21,,, ;,,,, 35,,,,,, 21,,,,,,,, ;,,,, ;,, : ( 1), ; ( 2) ; ( 3),,, ; ( 4),

4 2 Java :,, ;, ;,,,,, :,,,,,,, gzgz@ tup.tsinghua.edu.cn,,,

5 Java,,,,,,,,,,,, IT, NIIT ( National Institute Information Technology, ) APP T EC H,,, I T (),,,,, IT, ;,,,,, IT,,

6 4 Java,,,,,,,,,,,, ( ),,,,,,,,,,, ( 1) IT, I T ( 2), ( 3), Java.NET, ( 4), ( 5),,, ( 6) ;, ( 7)

7 5 ( 1) C++ SQL Se rver XML VC # Java J2E E VB.NE T J2ME Linux ASP.NE T ,,, C++ Linux Java, C++ Java 1 Linux SQL Server J2EE, SQL Server J2EE 2 XML VB.NET ASP.NE T, VB.NET ASP.NE T 3 XML VC # J2ME, VC # J2ME 4, ) ( 2) Java Java( + Linux)J2EE( + XML + + SQL Server ) J2ME ( +.NET C++ VB.NET, Asp.NE T ( + XML + + SQL Server ) VC # ( + ), 1. C++ Linux Java, C++ Java C++,,

8 6 Java Java Linux Linux, C++/ Java,,,,,, C++ Java,,,,,,,, 2. SQL Server J2EE, SQL Server J2EE SQL Server, / SQL, J2EE Java SQL Server, UML, UML, UML, UML UML,,, C++, ;, ; UML,, SQL Server, J2EE,, 3. XMLVB. NET ASP. NET, VB.NE T ASP.NET VB.NET VB.NET ADO.NET, VB.NET

9 7 ASP NET Web ASP.NE T, ASP.NE T XML XML,.NET UML,.NE T, XML,, 4. VC # J2ME, VC # J2ME VC # VC #, VC #, ADO.NE T J2ME J2ME,,.NET, J2ME VC #,, VC #, J2ME, ( ) 50%, ( ) 40%, 10 %,, 60,,,,,,,

10 Java Java, C++, Java,,, Web 9, Java, Java,,, Applet,,,,, NIIT APP T EC H,,,,,,, 40, 20, C++,, Java, JCreator JDK,, JDK : 1 Java Java Java Java 2 Java G UI JF rame 3 Java 4 5 Applet 6 Java 7 Java I/ O,

11 10 Java 9 TCP/ IP Socket, Socket,,,

12 Java, / ( C/ S ) / ( B/ S) : ( 1) ; ( 2) ; ( 3),,, Java, B/ S Java Applet Applet Socket, Applet,,, Java,,,,,, : ( 1) ( 2) ( 3),

13 12 Java,,, : ( 1), ; ( 2), ; ( 3) ; ( 4) ; ( 5) Internet, ; ( 6) Internet ; ( 7) ; ( 8),,,, : B/ S, C/ S

14 13. ( 1), ( 2), ( 3) Int ernet, 3. ( 1) ( 0-1) 0-1 flightno flightda te flightfrom flightto flightstart Time flightendtime flightfirstclassfare flightbusinessclassfare flighteconomyclassfare flightseatn um ( 2) ( 0-2)

15 14 Java 0-2 ID customerid customername customersex customerage customeraddress customer customerp hone

16 Java 1 Java Java Java Java Java Java Java Java Java G UI

17 16 Java Applet Applet Applet Applet H TML Applet Applet Applet Applet Web

18 th row throws File RandomAccessFile File RandomAccessFile Vector Socket / / T CP/ IP 183

19 18 Java

20 Java Java Java Java 1.1 Java Java Java Sun Microsystems 1995 ( objectoriented),, Java Java :,,,,,,, ;,, Java CPU ;, Java, Java 1. Java,,, Java,,,, Java, 40KB,

21 2 Java 15KB, 215KB Java,, Java,, 2. Java,, ;,,, 3. Java,,, Java,, Java Java, Java C, Java : C C++,, ; Java,, 4., Java,, ;, Java, C C++ ;, Java,, Java,,,, 5.,, ( Basic ), Java,, ( 1) : Java,, CPU

22 Java 3 ( 2) :,,,, Java ( 3) C : Java, C,, C,, 6. Java,,, Java, Java Applet ( ), HotJava, Applet, HotJava( Sun Java Web ), Java 7., Java W WW / ( C/ S), Java U RL,, URL,, Java Applet,, Java,, Java Java Java, : ( Application ) ( Applet),,,,

23 4 Java Web Java IE 4.0 Netscape N avigator 4.0 HotJava, Web Web,,,, Java :,, ;,,,, ; Java, Java,, Java Java JVM ( Java Virtual Machine)Java, Java Java, Java Java, Java, Java Java Java Java, JVM, Java Java Windows Linux Solaris 1-1 Java 1-1 : Sun JRE( Java 2 Runtime Environment), Java

24 Java Java Java,, I/ O XML, 1. Java Java ( JDK)Sun Java,??,, Java, Sun JDK,,, JDK Java Javac Java appletviewer Java doc Java Java, JavaApplet Java, Java H TML, H T ML Java Javah C, Javah Java C++ jdb Java,Java 2. Java Java Windows Java,,, Java, Sun Borland IBM, : JCrea tor JBuilderVisualAge For Java Sun ONE Studio, Java Java, Java

25 6 Java,, Java, JCreator Java JDK, Sun, JDK 1.4 JDK, JDK 1.2 Java Java Java, Java, Java 1-1 / * WelcomeApp.java */ import java.lang.system ; clas s WelcomeApp public static void main( String args [ ] ) System.out.println( Welcome to Java World! ) ; Java : Welcome to Java World! C C++, Java C Java :, 1 / * */, WelcomeApp.java Java java 2 import System, JDK, java.lang, : import java.lang.system ; 3 WelcomeApp, Java ( class)(int erface) All In Class

26 Java WelcomeApp, 1-1 WelcomeApp,, : public sta tic void main( String args[ ] ) public, void, static main, main,,,, 5, main System out println, : System.out.println( Welcome to Java World! ) ; println, import, System Java, : ( 1).java, WelcomeApp.java ( 2) : javac WelcomeApp.java, 1-1 WelcomeApp.class ( 3) : java WelcomeApp,,.class, : ( ) java WelcomeApp ( ) java WelcomeApp.class, : Can t find class WelcomeA pp.class. classjava,.class, Java, Java

27 8 Java., ( ) ( ),,,, Java All In Class, 1-2 clas s Application / / String strapp; int i ; / / public void add( ) / / class,, Java new, Clas sname objectname = new Clas sname( ) ; ClassName objectname = null ; objectname = new ClassName( ) ; / / ClassName, / / ClassName,objectName, ;,, : Java,

28 Java 9 2. Java ( constructor), C++,,, void,, Java 1-3 public clas s A pplication String name ; int age ; / / public App lication( ) name = Jack ; age = 21 ; / / public Application( String name, int age) this.name = name ; this.age = age; Application, : ( 1) A pplication obja pp1 = new App lication( ) ; ( 2) Application objapp2 = new Application( Rose, 21 ) ;, objapp1,, Jack 21, objapp2,, : this, this 3. Java, Java :

29 10 Java byte int short long float double, / bit byte 8 shor t 16 int 32 long 64 float 32 double 64 cha r 16 boolea n 1 4. Java, new, Java : < data_type > [ ] < array_name > ; < data_type > < array_name > [ ] ; Java, C++, 1-4 public class Student / / marksenglish markshistory, markshistory int[ ] mark senglis h; int[ ] mark shistory = 70,80,90 ; St ring[ ] subjects ; public Student( ) marksenglish = new int[ 3] ; s ubjects = new String[2 ] ;

30 Java 11 s ubjects [0] = new String( English ) ; s ubjects [1] = new String( History ) ; 1-4, mark sh istory, Java, V ector Vector,, 5. main Java Java, Java main Java, main ( Applet ) main 1-5 public class Welcome public static void main( String[ ] args ) / / do something Java main,, main p ublic main sta tic, ; void ; public static void,, args 6. Java ( String ),, 1-6 public class StrDemo String str = H ello, World ; public StrDemo( )

31 12 Java / / System.out.println( str) ; public static void main( String args [ ] ) new StrDemo( ) ; 1-6, StrDemo, str, H ello, World str, main, main, StrDemo, StrDemo,, H ello, World : Syst em, out ; println out, 7., Java extends : Java class Book public Book( ) / / class T extbook extends Book public T extbook( ) / /, 1-7, TextBook, : super( ) ;

32 Java 13,, class Book public Book( St ring title) System.out.println( title) ; / / class T extbook extends Book public TextBook( ) / /,, : public T extbook( St ring title) super( title) ; 8.,,, Java public private protected private protected, package() package,, ( 1) public:, public, ( 2) private: private,

33 14 Java ) ( 3) protected: protected :,, protect ed ( 4) private protected: private protected,, protected, private protected,, ( 5) :,, Package 1 A B D, Package 2 C, B C A A x,, B C D x protected x x private x private protected : Java, public,, ( private protect ed ) private

34 Java 15 protect ed 9. Java abstract : public abstract class Motor abstract public int geth orsepower( ) ; (interface) public in terface Motor public int geth orsepower( ) ; implements 1-8 public in terface Au thor public void input Title( String title) ; public class TextBook implements Author public void input Title( String title),,,,,,,, : extends, implements extends, implements 10.,

35 16 Java Java? ( package), Java, :, ( 1 ), package 1-9, Book mypackage 1-9 package mypackage ; public class Book / / package, mypackage, Book class, : package mypackage.mysub Package ; mypackage mysubpackage ( 2) import, Java,, 1-9, : mypackage.m ysubpacka ge.book bookobj = new mypackage.m ysubpack age.book( ) ;,, : import mypackage.mysubpackage. * ; *, Book : Book bookobj = new Book( ) ;, import, Java Java 21,, import

36 Java import Java.awt.* ; import Java.awt.event.* ; 1-10, import, Java, Java.lang, Java.lang Java 21,, Sy stem lang : import Java.lang.* ; Java, import :,*,, : import Java.awt.* ; import Java.awt.event.* ; 11. Java ( 1) Javac Java, class Javac <.Java > ( 2) Java Java < class >,, / : Java pack agename/ clas sname : Java Java,, Javac, class.class, class H TML, appletviewer , Jack

37 18 Java.,,,,,, Java,, Java,, main 3. ( 1),, String customers : St ring[ ] customers = null;, customers = new String[ ] Rose, Smith, John, Jack,Mark ; ( 2) for, for, length, 0, length - 1 for( int i = 0; i < = customers.length - 1; i + + ) / /, ( 3), Jack is founded ;, Jack is not founded ( 4) import Java.lang.* ;

38 Java 19 public class Customers String[ ] customers = null ; public Custo me rs( ) customers = new String[ ] Jack ; private boolean search( ) for( int i = 0; i < = customers.length - 1; i + + ) if( customers [i].equals ( Rose, Smith, John, Jack, Mark ) ) return true ; return false ; public static void main( String[ ] args ) boolean bl = false; Customers obj = new Customers ( ) ; bl = obj.sea rch( ) ; if( bl) else System.out.println( Jack is founded ) ; System.out.println( ack is not founde ) ; ( 5) Customers.Java, Javac Customers.class Java, 1-3 : Java

39 20 Java 1-3, 25 ( : 20, 30, 23, 28, 24, 33, 29, 22 ) 1.3 ( 1) Java ( 2) Java JVM ( Java Virtual Machine) Java, Java ( 3) Java ( JDK) Sun Java JDK Java ( 4) Java Javac Java, class Javac <.java > Java Java < class > 1. Java? 2. Java? 3. Java Application Java Applet? :

40 ,,,,,,, ;,, ( CUI) ( GUI) CUI, CUI MS-DOS,, G UI,, GUI Microsoft Windows, G UI G UI G UI :

41 22 Java, :, Java GUI,,?,, 1 Java,,,,, Java 1.0, java.awt Java AW T,, Component,,, Component, Component 2-1 Component java.aw t 2-1, Component, Button ( ) Choice( )Text Area(

42 23 ) TextField ( ) List ( ) Label ( ) Container ( ) Window() Panel( ) ZWT, :?, import java.awt. * ; public clas s Welco mewin Frame frame = null ; Label la bel = null ; public Welco mewin( ) frame = new Frame( ) ; label = new Label( ) ; frame.add( label) ; frame.setsize(300, 100 ) ; frame.setvisible( true) ; public static void main( String args [ ] ) / / main, WelcomeWin app = new WelcomeWin( ) ; 2-1 Frame, setsize( ) set Visible( ), AW T,, AWT, java.aw t.

43 24 Java Button Windows Macintosh,,, Sun Java ( JFC ) JFC A WT JFC Java,, JFC AW T, AW T JFC1.2, javax.swing javax.swing G UI, G UI J, Swing 2-1Swing 2-1 JFrame java.awt.frame JApplet java.applet.applet JBut ton JCheckBox JComboBox JDialog Swing,AW T Dialog JLable JList JOptionPane JPasswordField, JPanel JRadioBut ton JT able JT exta rea JT extfield Swing,, :

44 25 1. JFrame ( JF rame), Frame, Container JFrame : JF rame myframe = new JFrame( ) ; / / JF rame myframe = new JFrame( My Frame ) ; / /,, show ( ), setsize( ) 2-2 / / Swing import javax.swing.* ; public clas s Hello_ java JFrame frame ; JLab el label; public Hello_ java( ) / / frame frame = new JFrame( Hello Java ) ; / / label = new JLabel( Hello Java ) ; / / frame.getcontentpane( ).add( label) ; / / frame.setvisible( true) ; / / frame.setsize(300, 300 ) ; public static void main( String[ ] agrs ) H ello_ java obj = new Hello_ java( ) ; : Swing ( JWindow JFrame JDialog JApplet ) contentpane Swing AW T,, contentpane, Swing

45 26 Java 2-3 getcontentpane( )contentpane 2. JPanel JPanel, ( ),, 2-3 JPanel 2-3 import javax.swing.* ; public class JPanelDemo public JPanelDemo( ) JFrame frame = new JFrame( JPanal Demo ) ; JButton b1 = new JBut ton( Button1 ) ; / / panel JPanel panel = new JPanel( ) ; / / panel.add( b1 ) ; / / frame.getcontentpane( ).add( panel) ; frame.setvisible(true) ; frame.setsize(300,300) ;, panel,, panel : / / panel1, panel2 frame.remove( pa nel1) ; frame.getcontentpane( ).add( panel2) ; frame.setvisible( true) ;

46 27 frame.setsize( 300,300) ; remove set Visible( )setsize( ), 3. panel1, panel2, JLable : JLabel label = new JLabel( Hello, World ) ; panel.add( label) ;,, J TextField : get Text( ), set Text( ) JText Field : JTextField text = new J TextField( 10 ) ; panel.add( text) ; : text.sett ext( mm/ dd/ yy ) ; : String birth = text.get Text( ) ;, JText Field, JPasswordField, * 4. JList()JComboBox (),, JList JF rame frame = new JFrame( Customer Details Frame ) ; JPanel panel = new JPanel( ) ; / /, JList String[ ] city =,,, ; / / Jlist, JList listcity = new JList( city) ;

47 28 Java panel add( listcity) ; frame.getcontentpane( ).add( panel) ;, setselectionmode ( ), SINGLE_SEL ECTION SINGLE_INT ERVAL_SE LECTION MU LTIPLE_INT ERVAL_SE LECTION JList O bject getselectedval ue( ) int getselectedindex( ) O bject[ ] getselectedvalues( ) int[ ] getselectedindices ( ) int getminselectionindex( ) int getmaxselectionindex ( ) void setvisiblerowcount(int count) boolean isselectedindex(int index) boolean isselectionempty( ) void setlistdata( Object[ ] listdata) void setlistdata( Vector listdata), null,,, - 1,, 0,,, true Vector ( ) JComboBox(), String[ ] city =,, ; JComboBox com boobj = new JComboBox( city) ;,,,

48 29, seteditable( true), is Editable( ) JComboBox void additem( Object item) Object getitemat(int index) int getitemcount( ) Object getselecteditem( ) int getselectedindex( ) void setmaximumrowcount(int count),, null,,null 5. JCheckBox, JRadioButton 2-4 import javax.swing.* ; import java.awt. * ; import java.awt.event.* ; public class Test extends JFrame JLabel lbllike, lblknowledge ; JCheckBox music, tour,dance, book; JRadioButton grade, high, college ; / / ButtonGroup buttongroup; JPanel panel ; public Test( ) super( T est ) ; panel = new JPanel( ) ; music = new JCheckBox( ) ; tour = new JCheckBox( ) ; dance = new JCheckBox( ) ; book = new JCheckBox( ) ; grade = new JRadioButton( ) ;

49 30 Java high = new JRadioButton( ) ; college = new JRadioButton( ) ; / /, but tongroup = new ButtonGroup( ) ; but tongroup.add( grade) ; but tongroup.add( high ) ; but tongroup.add(college) ; lbllike = new JLabel( ) ; lblknowledge = new JLabel( ) ; panel.add(lbllike) ; panel.add( music) ; panel.add( tour) ; panel.add( dance) ; panel.add( book) ; panel.add(lblknowledge) ; panel.add( grade) ; panel.add( high) ; panel.add(college) ; Container con tentpane = getcon tentpane( ) ; contentpane.add( panel) ; setsize(300, 100) ; setvisible( true) ; public static void main( String[ ] args ) new T est( ) ; , JCheckBox JRadioBut ton

50 31, But tongroup,,? bu ttongroup = new But tongroup( ) ; buttongroup.add( grade) ; bu ttongroup.add( high) ; buttongroup.add(college) ;,,, radio,,,,,, JCheckBox JRadioButton isselected ( ), setselected( boolean) 6. Windows,, Java JOptionPane JOptionPane,, 2-5, 2-5 ShowConfirmDialog( ),yes/ no/ cancel ShowInputDialog( ) ShowMessageDialog( ) JOptionPane : JOptionPane. showmessagedialog ( null,alert alert, JOptionPane. E RROR _ MESSAGE) ; : 1, null, frame ERROR _MESSAGE ( )

51 32 Java IN FORMA TION ME SSAGE ( )WARNIN G _ ME SSAGE ( ) QUESTION_MESSAGE( ) PLAIN_MESSAGE ( ) JOptionPane.s howconfirmdialog ( null, choose one, choose one, JOptionPane. YES_N O_O P TION) ;, 4 DE FA ULT_OP TION( ) YE S_N O_ OP TIO N ( yes/ no )YES_ N O_ CANCEL _ OP TION ( yes/ no/ cancel )OK _ CA NCEL_OP TION(ok/ cancel ) JOptionPane.showInputDialog ( Please input a value )

52 ,,,,, /,,,,, :,,,,, 10, 10, 2, 10, 11, 2,, : ; ; 3. ( 1) labelfligh tno JLa bel text Fligh tno JT extfield labelfligh tdate JLa bel text Fligh tdate JT extfield labelfligh tfrom JLa bel text Fligh tfrom JT extfield labelfligh tt o JLa bel text Fligh t To JT extfield

53 34 Java la belflightstar t Time JLa bel tex tflightstar t Time JT extfield la belflight End Time JLa bel tex tflight End Time JT extfield la belflightfirst Class Fa re JLa bel tex tflight First Class Fare JT extfield la belflightbusinessclass Fare JLa bel tex tflight BusinessClass Fare JT extfield la belflight Econom yclass Fare JLa bel tex tflight Econo myclas sfar e JT extfield la belflightseatnu m JLa bel tex tflightseatnu m JT extfield LabelTitle JLa bel frame J Frame pa nel JPanel cm dsubmit JBut ton cm dcancel JBu tt on ( 2), / bit textfligh tno JT extfield 5 textfligh tdate JT extfield 10 textfligh tfrom JT extfield 20 textfligh tt o JT extfield 20 textfligh tsta rt Time JT extfield 10 textfligh te nd Time JT extfield 10 textfligh tfi rstclas sfar e JT extfield 10 textfligh tbusines sclas s Fa re JT extfield 10 textfligh teconomyclas s Fa re JT extfield 10 textfligh tseat Num JT extfield 10 ( 3), ( 4)

54 35 import javax.swing.* ; public clas s Fligh tinfo / / JFrame frame ; JPanel panel ; / / JLabel labelflightno; JLab el labelfligh tda te; JLab el labelfligh tfrom ; JLabel labelflightto; JLab el labelfligh tstar t Time; JLabel labelflightendtime; JLab el labelfligh tfir stclass Fare ; JLab el labelfligh tbusin essclas sfar e; JLab el labelfligh teconomyclas sfar e ; JLabel labelflightseatn um ; JLab el labeltitle; / / JTex tfield tex tflightno ; JTex tfield tex tflightdate ; JTextField textflight From ; JTextField textflight To; JTextField textflightstart Time ; JTextField textflight EndTime ; JTextField textflight FirstClassFare ; JTex tfield tex tflight BusinessClass Fare ; JTex tfield tex tflight Econo myclass Far e; JTex tfield tex tflightseatnu m ; / / JButton cmdsubmit ; JButton cmdcancel ; / / public Fligh tinfo( ) frame = new JFrame( ) ; frame.setsize(500,500) ; frame.setvisible(true) ; panel = new JPanel( ) ;

55 36 Java frame.getcontentpane( ).add( panel) ; / / labelt itle = new JLabel( ) ; labelflightno = new JLabel( ) ; labelflightdate = new JLabel( ) ; labelflightf rom = new JLabel( ) ; labelflight To = new JLabel( ) ; labelflightstartt ime = new JLabel( ) ; labelflight EndT ime = new JLabel( ) ; labelflightfirstclassfare = new JLabel( ) ; labelflightbusinessclassfare = new JLabel( ) ; labelflight EconomyClassFare = new JLabel( ) ; labelflightseatnum = new JLabel( ) ; / / tex tflightno = new JTex tfield( 5) ; tex tflightdate = new JTe xtfield(10) ; textflightf rom = new JTextField (20 ) ; tex tflight T o = new JTex tfield(20) ; tex tflightstar tt ime = new JTe xtfield(10) ; tex tflight EndT ime = new JTe xtfield(10) ; tex tflightfirstclass Fa re = new JTex tfield(10) ; tex tflightbusinessclass Fare = new JT extfield( 10) ; tex tflight Econom yclass Fare = new JT extfield( 10) ; tex tflightseatnum = new JTex tfield (10 ) ; / / cmdsubmit = new JBut ton( ) ; cmdcancel = new JBut ton( ) ; / / pa nel.add( labeltitle) ; panel.add(labelflightno) ; panel.add( text FlightNo) ; pa nel.add( labelfligh tdate) ; panel.add( text FlightDate) ; panel.add(labelflightfrom) ; panel.add( text FlightFrom) ;

56 37 panel.add(labelflight To) ; panel.add( text Flight To) ; panel.add(labelflightstarttime) ; panel.add( text FlightStart Time) ; panel.add(labelflightendtime) ; panel.add( text FlightEndTime) ; pa nel.add( labelfligh tfirstclas sfar e) ; panel.add( text FlightFirstClassFare) ; panel.add(labelflightbusinessclassfare) ; panel.add( text FlightBusinessClassFare) ; panel.add(labelflighteconomyclassfare) ; panel.add( text FlightEconomyClassFare) ; panel.add(labelflightsea tnum) ; panel.add( text FlightSea tnum) ; panel.add(cmdsubmit) ; panel.add(cmdcancel) ; public static void main( String[ ] args ) new FlightInfo( ) ; ( 5), 2-8,,

57 38 Java ( 1) GUI : ( 2) Java 1.0, AW T( ) AW T ( 3) Java AW T javax.swing ( 4) javax.swing ( ) 1. AW T JFC 2. JFrame.getContent Pane( ),? 3. : import javax.swing.* ; public class Sample static JF rame frame ; JPanel panel ; JButton but ton; public Sample( ) panel = new JPanel( ) ;

58 39 but ton = new JButton( s ubmit ) ; panel.add( but ton ) ; but ton.setlabel( cancel ) ; panel.add( but ton ) ; public static void main( String[ ] args ) frame = new JF rame( Sample Programe ) ; frame.getcontent Pane( ).add( panel) ; frame.setsize(300,300) ; 4., ( ) ( )()

59 FlowLayout GridLayout BorderLayout CardLayout GridBagLayout,,,,,, ( Layout Manager ),, Java,, AWT FlowLayout GridLayout BorderLayout CardLayout GridBagLayout, java.lang.object, set Layout( ):

60 41 containtobj.setlayout(layoutobj) ; containtobj, layoutobj 1. FlowLayout FlowLayout,,, FlowLayout FlowLayout : FlowLayout( ) :,, 5 FlowLayout ( int align ) :, align FlowLayout. LE F T ( ) FlowLayout. RIG H T ( ) FlowLayout.CENTE R( ),, 5 FlowLayout (int align, int hgap, int vgap) :,, hgap vgap 3-1 import java.awt. * ; import javax.swing.* ; public class SampleLayout JButton but ton1, button2, button3 ; FlowLayout f1 ; JFrame frame ; public Sam plelayout( ) frame = new JFrame( SampleLayout ) ; / / f1 = new FlowLayout(FlowLayout.LEFT) ; JPanel p1 = new JPanel( ) ; frame.getcontentpane( ).add( p1 ) ; / / p1 p1.setlayout( f1) ; but ton1 = new JButton( Ok ) ; but ton2 = new JButton( Open ) ; but ton3 = new JButton( Close ) ;

61 42 Java p1.add( button1 ) ; p1.add( button2 ) ; p1.add( button3 ) ; frame.setvisible(true) ; frame.setsize(300,300) ; public static void main( String[ ] args ) new SampleLayout( ) ; 3-1, FlowLayout, panel set Layout( ) panel,,, BorderLayout: BorderLayout : BorderLayout( ) BorderLayout(int hgap, int vgap), 3-2 import java.awt. * ; import javax.swing.* ;

62 43 public class SampleLayout2 public Sam plelayout2 ( ) JFrame frame = new JFrame( SampleLayout2 ) ; JPanel panel = new JPanel( ) ; panel.setlayout( new BorderLayout( ) ) ; panel.add(new JButton( North ), BorderLayout.NORTH) ; panel.add(new JButton( South ), BorderLayout.SOUTH) ; panel.add(new JButton( East ), BorderLayout.EAST) ; panel.add(new JButton(West ), BorderLayout.WEST) ; panel.add(new JButton( Center ), BorderLayout.CENTER) ; frame.getcontentpane( ).add( panel) ; frame.setvisible(true) ; frame.setsize(300,300) ; public static void main( String[ ] args ) new SampleLayout2( ) ; 3-2,, panel, panel, NOR TH SOU T HEASTWES T CEN TER static 3-3, panel GridLayout:,,, GridLayout(int rows, int cols ) :

63 44 Java GridLayout int rows, int cols, int hgap, int vgap) : 3-3 import java.awt. * ; import javax.swing.* ; public class SampleLayout3 public Sam plelayout3 ( ) JFrame frame = new JFrame( SampleLayout3 ) ; JPanel panel = new JPanel( ) ; panel.setlayout(new GridLayout( 3,2 ) ) ; panel.add(new JButton( 1 ) ) ; panel.add(new JButton( 2 ) ) ; panel.add(new JButton( 3 ) ) ; panel.add(new JButton( 4 ) ) ; panel.add(new JButton( 5 ) ) ; panel.add(new JButton( 6 ) ) ; frame.getcon tentpane( ).add( panel) ; frame.setvisible(true) ; frame.setsize(300,300) ; public static void main( String[ ] args ) new SampleLayout3( ) ; 3-3, 3 2, panel, panel ( 3-4 )3-3, 6 6,,,? 3-4

64 45 4. CardLayout:,, Windows, CardLayout( ) : CardLayout(int h gap, int vgap) :,, CardLayout, first(container parent) last( Container parent) next(container parent) previous( Container parent) show( Container parent, String name) 3-4 (, 4, ) import java.awt. * ; import javax.swing.* ; import java.awt.event.* ; public clas s Sam plelayou t4 implemen ts Action Listener JPanel panel1; JPanel panel2; JPanel panel3; JPanel panel4; JPanel panel5; JPanel panel6; JLabel label1 ; JLabel label2 ; JLabel label3 ;

65 46 Java JLabel label4 ; JButton but ton1; JButton but ton2; JButton but ton3; JButton but ton4; CardLayou t ca rdlayout ; public Sam plelayout4 ( ) JFrame frame = new JFrame( SampleLayout4 ) ; pa nel1 = new JPanel( ) ; pa nel2 = new JPanel( ) ; pa nel3 = new JPanel( ) ; pa nel4 = new JPanel( ) ; pa nel5 = new JPanel( ) ; pa nel6 = new JPanel( ) ; label1 = new JLabel( card1 ) ; label2 = new JLabel( card2 ) ; label3 = new JLabel( card3 ) ; label4 = new JLabel( card4 ) ; but ton1 = new JButton( first ) ; but ton2 = new JButton( next ) ; but ton3 = new JButton( preview ) ; but ton4 = new JButton( last ) ; but ton1.addactionlistener( t his ) ; but ton2.addactionlistener( t his ) ; but ton3.addactionlistener( t his ) ; but ton4.addactionlistener( t his ) ; / / frame.getcontentpane( ).setlayout( new BorderLayout( ) ) ; frame.getcontentpane( ).add( panel1,borderlayout.nort H ) ; frame.getcontentpane( ).add( panel2,borderlayout.sout H ) ; / / panel2.setlayout( new GridLayout(1,4) ) ; panel2.add( button1) ;

66 47 panel2.add( button2) ; panel2.add( button3) ; panel2.add( button4) ; panel3.add( label1) ; panel4.add( label2) ; panel5.add( label3) ; panel6.add( label4) ; / / cardlayout = new CardLayout( ) ; panel1.setlayout( cardlayout) ; panel1.add( card1, panel3 ) ; panel1.add( card2, panel4 ) ; panel1.add( card3, panel5 ) ; panel1.add( card4, panel6 ) ; frame.setvisible(true) ; frame.setsize(300,300) ; / / public void actionperfor med( ActionE vent ev t) Object obj = evt.getsource( ) ; if(obj = = button1) cardlayout.first( panel1) ; if(obj = = button2) cardlayout.next( panel1) ; if(obj = = button3) cardlayout.previous( panel1) ; if(obj = = button4) cardlayout.last( panel1) ;

67 48 Java public static void main( String[ ] args ) new SampleLayout4( ) ; 3-4, ( 3-5 ), panel : frame.get Con ten tpa ne( ). setlayou t ( n ew Border- Layout( ) ) ; frame.getconten tpane ( ).add ( panel1, Borde rlayou t. NO RT H ) ; frame.getconten tpane ( ).add ( panel2, Borde rlayou t. SOU T H ) ; 3-5 panel2, : panel2.set Layout( new GridLayout(1,4) ) ; panel2.add ( button1 ) ; panel2.add ( button2 ) ; panel2.add ( button3 ) ; panel2.add ( button4 ) ; panel1, : cardlayout = new CardLayout( ) ; panel1.set Layout(cardLayout) ; panel1.add ( card1, panel3 ) ; panel1.add ( card2, panel4 ) ; panel1.add ( card3, panel5 ) ; panel1.add ( card4, panel6 ) ; panel1 add ( ), panel1 3-4,,,, : cardlayout.first( panel1) ;

68 49 cardlayout.next( panel1 ) ; cardlayout.last( panel1 ) ; cardlayout.previous ( panel1 ) ; panel1, 5. GridBagLayout: GridBag,, GridBag AWT, GridBag,,, X Y GridBag GridBagConstraints GridBagConstraints,, GridBag GridBagConstraints GridBagLayout setcon straints( )GridBagConstraints setconstraints (component, gbc) ; component, gbc GridBagCon straints 3-5 import java.awt. * ; import javax.swing.* ; import java.util.* ; public class SampleLayout5 JFrame frame ; JPanel panel ; G ridba glayout gridbag; G ridbagconstraints c ; protected void makebut ton( String name, GridBagLayout gridbag, GridBagConstraints c) JButton but ton = new JBut ton( name) ;

69 50 Java gridbag.setconstraints( but ton, c) ; panel.add( button) ; public Samp lelayout5 ( ) frame = new JFrame( SampleLayout5 ) ; / / gridbag = new GridBagLayout( ) ; / / c = new GridBagConstraints( ) ; / / panel gridbag panel = new JPanel( ) ; panel.setlayout( gridbag) ; c.fill = GridBagConstraints.BOTH; c.weightx = 1.0 ; makebutton( Button1, gridbag, c) ; makebutton( Button2, gridbag, c) ; makebutton( Button3, gridbag, c) ; c.gridwidth = GridBagConstraints.REMAINDER; makebutton( Button4, gridbag, c) ; c.weightx = 0.0 ; makebutton( Button5, gridbag, c) ; c.gridwidth = GridBagConstraints.RELATIVE; makebutton( Button6, gridbag, c) ; c.gridwidth = GridBagConstraints.REMAINDER; makebutton( Button7, gridbag, c) ; c.gridwidth = 1; c.gridheight = 2 ; c.weighty = 1.0 ; makebutton( Button8, gridbag, c) ;

70 51 c.weighty = 0.0 ; c.gridwidth = GridBagConstraints.REMAINDER; c.gridheight = 1 ; makebut ton( But ton9, gridbag, c) ; makebut ton( But ton10, gridbag, c) ; frame.getcontentpane( ).add( panel) ; frame.setsize(400,400) ; frame.setvisible( true) ; public static void main( String[ ] args ) new SampleLayout5( ) ; : c.fill = GridBagConst raints.bot H ; c.weightx = 1.0; makebutton( Button1, gridbag, c) ; makebutton( Button2, gridbag, c) ; makebutton( Button3, gridbag, c) ;, But ton1 But ton2 But ton3, GridBagConstraints fill weightx fill 3-2 :

71 52 Java 3-2 GridBagConstraints.NONE GridBagConstraints.HORIZONTAL GridBagConstraints.VERTICAL GridBagConstraints.BOT H,, weightx, 0 ( ), 1( ), weighty Button1 ton2 But ton3,, c.gridwid th = GridBagConst raints.rem AINDE R; makebutton( Button4, gridbag, c) ; c.weightx = 0.0; makebutton( Button5, gridbag, c) ; c.gridwid th = GridBagConst raints.re LAT IVE ; makebutton( Button6, gridbag, c) ; c.gridwid th = GridBagConst raints.rem AINDE R; makebutton( Button7, gridbag, c) ;, GridBagConstrains,, Button4 ton5 But ton6 Button7, gridwidth weightx gridwidth 1 GridBagCon straints.remainde R,,, GridBagConstraints. RELATIVE, 3-6, But ton4 Button5, But ton6 But ton7, gridheight c.gridwidth = 1 ; c.gridheight = 2 ; c.weighty = 1.0 ; makebutton( Button8, gridbag, c) ;

72 53,gridwidth = 1 ;gridheight = 2 ;weighty = Button8 c.weighty = 0.0 ; c.gridwid th = GridBagConst raints.rem AINDE R; c.gridheight = 1 ; makebutton( Button9, gridbag, c) ; makebutton( Button10, gridbag, c) ;, weighty 0, gridheight 1,, gridwidth GridBagConstraints.REMAINDER, But tonn9 Button10 :, GridBagConstraints, : anchor, GridBagConstraints.CEN TER (default) GridBagConstraints.NO RT H GridBagConstraints.NO RT H EAST GridBagConst rain ts.ea ST GridBagConstraints.SOU T H EAST GridBagConstraints.SOU T H GridBagConstraints.SOU T HW EST GridBagConst rain ts.west GridBagConstraints.NO RT H WEST gridx, gridy gridx gridy gridx = 0, gridy = 0 GridBagLayout, , 3-7

73 54 Java ,,,,,,,,, GridBagLayout, GridBagLayout,,, : anchor = GridBagConst raints.n OR T HE AST gridx = * * gridy = * * gridx gridy, 3-7,, gridx 1 gridy 5, gridx 3, gridy 3 : ; ;

74 55 3. ( 1) la belflightno JLabel tex tfligh tno J Tex tfield la belflightdate JLabel tex tfligh tdate J Tex tfield la belflightf ro m JLabel tex tfligh tf rom J Tex tfield la belflight T o JLabel tex tfligh t To J Tex tfield la belflightstar tt ime JLabel tex tfligh tsta r tt ime J Tex tfield la belflight EndT ime JLabel tex tfligh te nd T ime J Tex tfield la belflightfirst Class Fa re JLabel tex tfligh tfirstclas sfa re J Tex tfield la belflightbusinessclass Fare JLabel tex tfligh tbusines sclass Fa re J Tex tfield la belflight Econom yclass Fare JLabel tex tfligh teconomyclass Fa re J Tex tfield la belflightseatnu m JLabel tex tfligh tseatnum J Tex tfield panel JPanel frame JFrame but tonsubmit JBu tton ( 2), GridBagLayout GridBagLayout gl = new GridBagLayout( ) ; panel.setlayout(gl) ; ( 3) 3-4

75 56 Java 3-4 gridx gridy labelfligh tno 1 5 te xtfligh tno 4 5 labelfligh tda te 1 8 te xtfligh tda te 4 8 labelfligh tfrom 1 11 te xtfligh tfrom 4 11 labelfligh tt o 1 14 textflightto 4 14 labelfligh tstar t Time 1 17 te xtfligh tstar t Time 4 17 labelfligh te nd Time 1 20 textflightendtime 4 20 labelfligh tfir stclass Fare 1 23 te xtfligh tfir stclass Fare 4 23 labelfligh tbusin essclas sfar e 1 26 te xtfligh tbusinessclas sfar e 4 26 labelfligh teconomyclas sfar e 1 29 te xtfligh teconomyclas sfar e 4 29 labelfligh tseatn um 1 32 te xtfligh tseatn um 4 32 buttonsubmit 8 32 ( 4) import javax.swing.* ; import java.awt. * ; import java.applet. * ; public clas s Fligh tinfo JFrame frame ;

76 57 Container con tent ; JLabel labelflightno; JLab el labelfligh tda te; JLab el labelfligh tfrom ; JLabel labelflightto; JLab el labelfligh tstar t Time; JLabel labelflightendtime; JLab el labelfligh tfir stclass Fare ; JLab el labelfligh tbusin essclas sfar e; JLab el labelfligh teconomyclas sfar e ; JLabel labelflightseatn um ; JTex tfield tex tflightno ; JTex tfield tex tflightdate ; JTextField textflight From ; JTextField textflight To; JTextField textflightstart Time ; JTextField textflight EndTime ; JTextField textflight FirstClassFare ; JTex tfield tex tflight BusinessClass Fare ; JTex tfield tex tflight Econo myclass Far e; JTex tfield tex tflightseatnu m ; JButton but tonsubmit ; GridBagLayout gl ; GridBagConstr ain ts gbc; public void init( ) frame = new JFrame( ) ; frame.setsize(400,400) ; frame.setvisible(true) ; gl = new GridBagLayout( ) ; gbc = new GridBagConstr ain ts( ) ; conte nt = frame.getcon tentpane( ) ; content.setlayout(gl) ;

77 58 Java labelflightno = new JLabel( ) ; labelflightdate = new JLabel( ) ; labelflightf rom = new JLabel( ) ; labelflight To = new JLabel( ) ; labelflightstartt ime = new JLabel( ) ; labelflight EndT ime = new JLabel( ) ; labelflightfirstclassfare = new JLabel( ) ; labelflightbusinessclassfare = new JLabel( ) ; labelflight EconomyClassFare = new JLabel( ) ; labelflightseatnum = new JLabel( ) ; tex tflightno = new JTex tfield( 5) ; tex tflightdate = new JTe xtfield(10) ; textflightf rom = new JTextField (20 ) ; tex tflight T o = new JTex tfield(20) ; tex tflightstar tt ime = new JTe xtfield(10) ; tex tflight EndT ime = new JTe xtfield(10) ; tex tflightfirstclass Fa re = new JTex tfield(10) ; tex tflightbusinessclass Fare = new JT extfield( 10) ; tex tflight Econom yclass Fare = new JT extfield( 10) ; tex tflightseatnum = new JTex tfield (10 ) ; but tonsubmit = new JBut ton( ) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 5 ; gl.setconstraints( labelflightno, gbc) ; content.add( labelflightno) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 5 ; gl.setconstraints( textflightno, gbc) ; content.add( textflightno) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ;

78 59 gbc.gridy = 8 ; gl.setconstraints( labelflightdate,gbc) ; content.add( labelflightdate) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 8 ; gl.setconstraints( textflightdate,gbc) ; content.add( textflightdate) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 11 ; gl.setconstraints( labelflightf rom, gbc) ; content.add( labelflightf rom) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 11 ; gl.setconstraints( textflightf rom, gbc) ; content.add( textflightf rom) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 14 ; gl.setconstraints( labelflight To,gbc) ; content.add( labelflight To) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 14 ; gl.setconstraints( textflight To,gbc) ; content.add( textflight To) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 17 ; gl.setconstraints( labelflightstartt ime,gbc) ; content.add( labelflightstartt ime) ;

79 60 Java gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 17 ; gl.setconstraints( textflightstartt ime,gbc) ; content.add( textflightstartt ime) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 20 ; gl.setconstraints( labelflight EndT ime,gbc) ; content.add( labelflight EndT ime) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 20 ; gl.setconstraints( textflightendt ime,gbc) ; content.add( textflight EndT ime) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 23 ; gl.setconstraints( labelflightfirstclassfare,gbc) ; content.add( labelflightfirstclassfare) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 23 ; gl.setconstraints( textflightfirstclassfare,gbc) ; content.add( textflightfirstclassfare) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 26 ; gl.setconstraints( labelflightbusinessclassfare, gbc) ; conte nt.a dd( lab elflightbusinessclass Fare) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ;

80 61 gbc.gridy = 26 ; gl.setconstraints( textflightbusinessclassfare, gbc) ; content.add( textflightbusinessclassfare) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 29 ; gl.setconstraints( labelflight EconomyClassFare, gbc) ; content.add( labelflight EconomyClassFare) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 29 ; gl.setconstraints( textflighteconomyclassfare, gbc) ; content.add( textflight EconomyClassFare) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 32 ; gl.setconstr ain ts( labelfligh tseatnum, gbc) ; content.add( labelflightseatnum) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 32 ; gl.setconstraints( textflightseatnum, gbc) ; content.add( textflightseatnum) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 8 ; gbc.gridy = 32 ; gl.setconstraints( but tonsubmit,gbc) ; content.add( but tonsubmit) ; public static void main( String[ ] args ) FlightInfo obj = new FlightInfo( ) ; obj.init( ) ;

81 62 Java ( 5) H TML,,, 3.2 ( 1), ( 2) Java : FlowLayout GridLayout BorderLayout CardLayout GridBagLayout ( 3) FlowLayout Applet, ( 4) BorderLayout ( 5) GridLayout,,, ( 6) CardLayout,, ( 7) GridBagLayout AWT, GridBagLayout, 1. GridBagConstraints 2. FlowLayout,? A. add (Cent er, component) B. add( component)

82 63 C. add( x, y, component ) D. set(component) 3.? A. setlayout( mylayout) B. addlayout( mylayout) C. layout( mylayout) D. setlayoutmanager ( mylayout) 4., 3-8 ( : BorderLayout panel, panel ) 3-8

83 ,,,,,,,, ( ),, ( ),,, 2,,, ( ), ( ) Java, G UI,, GUI,,, ( 1) G UI, ( ),,

84 65 ( ) ( ) java.util.eventobject, ActionEvent ( 2),, ActionEvent ;, WindowEvent ( 3), Java, java.util EventObject EventObject A WTEvent, AWT java.awt.event java.awt.aw TEvent, AWT : G UI,, ActionEvent, TextField, Enter,,, Mou seevent, java.awt.event : ActionEvent Enter; Adju stmentevent ; ItemEvent ; Text Event, : Component Event, ; ContainerEvent / ; FocusEvent ; WindowEvent ; KeyEvent ; MouseEvent, :, KeyEvent, MouseEvent, ActionEvent

85 66 Java WindowEvent, Focu sevent, ItemEvent Java, GUI, GUI, GUI, Java :, ( ) ( ), ( ) 4-2,,,,,,,,,,

86 VolumenessControl, : / / public in terface VolumenessCont rol void increasevolumeness ( ) / / void decreasevolumeness ( ) / / / / public class TV implements VolumenessCont rol void increasevolumeness ( ) / / / / void decreasevolumeness ( ) / / / / / / public class AUDIO implements VolumenessControl void increasevolumeness ( ) / / / / void decreasevolumeness ( ) / / / /

87 68 Java ActionListencr actionperformed( ActionEvent) ItemListencr itemstatechanged( Item Event) AdjustmentListener adjustmentvaluechanged(adjustment Event) componenth idden( ComponentEvent) Component Listener componen tmoved( Compon ent Event) componentresized( Component Event) componen tshown( Componen te vent) mouseclicked( MouseEvent) mouseentered( MouseEvent) MouseListener mousee xited( MouseEven t) mouser eleased( MouseEven t) mousepr essed( MouseE vent) MouseMotionListener mousedr agged( MouseEven t) mousemoved( MouseE vent) WindowListener KeyListener window Activated( WindowEven t) windowdeactivated( WindowE vent) windowop ened( WindowEven t) windowclosed( WindowEve nt) windowclosing ( WindowEven t) windowiconified( WindowEvent) windowdeiconified( WindowEven t) void keyp ressed ( KeyEvent) void keyreleased( KeyE vent) void keytyped ( KeyEvent) :,,

88 69, /, mou sereleased mou sep ressed, MouseListener , JF rame,, : ; ; ; 2.,, :,,,,,,, ; 3. ( 1) : but tonsubmit : gbc.gridx = 8 ; gbc.gridy = 32; ( 2),,,,, Money,, ( 3),,, 4-1, 4-1 / / ListenerT est.java

89 70 Java import java awt. * ; import java.awt.event.* ; import java.util.* ; import javax.swing.* ; public class ListenerT est extends JFrame JBut ton button; JPan el panel; public ListenerTest ( ) panel = new JPanel( ) ; button = new JBut ton( test ) ; getcontentpane( ).add( panel) ; panel.add( but ton) ; setsize( 100,100) ; setvisible( true) ; / / MyListen er listen = new MyListe ner( ) ; / / button.addactionlistener( listen) ; clas s MyListene r implemen ts Action Listener public void actionperformed( Action Even t event) / / System.out.println( This is a listener. ) ; public static void main( String args [ ] ) ListenerT est test = new ListenerTest( ) ; :, This is a listener., : ActionEvent ;

90 71 ActionEvent, ; actionperformed( )ActionEvent ; actionperformed( ),, ItemEvent(), 4-2,, : 4-2 / / ItemEvent Test.java import java.awt. * ; import java.awt.event.* ; import java.util.* ; import javax.swing.* ; public class ItemEvent Test extends JF rame JButton but ton; Choice choice = new Choice( ) ; JPanel panel = new JPanel( ) ; public ItemEvent Test ( ) s uper( test item Event window ) ; but ton = new JButton( click here ) ; but ton.setbackground( Color.yellow ) ; choice.additem( red ) ; choice.additem( green ) ; choice.additem( white ) ; getcontentpane( ).add( panel) ; panel.add(choice) ; panel.add( but ton) ; ButtonListener Blisten = new ButtonListener( ) ; ChoiceListener Clisten = new ChoiceListener( ) ; but ton.addactionlistene r(blisten) ; choice.additemlistener( Clisten) ; clas s Bu ttonlisten er implements ActionListene r public void actionperfor med( ActionE vent even t)

91 72 Java JBut ton source = ( JButton)event.getSource( ) ; source.set Text( but ton clicked ) ; clas s ChoiceListener im plemen ts ItemListene r public void itemsta techanged( ItemEve nt even t) if(choice.getselecteditem( ) = = red ) button.setbackground( Color.red ) ; else if( choice.getselecteditem( ) = = green ) bu tt on.setbackground( Color.green) ; else if( choice.getselecteditem( ) = = white ) button.setbackground( Color.white) ; public static void main( String args[ ] ) ItemEvent Test butitem = new ItemEventT est( ) ; butitem.setsize(300,300 ) ; butitem.show( ) ; :, ; addactionlistener additemlistener ;

92 73, ActionEvent, actionperformed, getsource ( ) ;, ItemEvent, it emstatechanged, getselect editem ,,, java.aw t. * java.awt.event. *, ( 4),, (,, ) import javax.swing.* ; import java.awt. * ; import java.applet. * ; public clas s Fligh tinfo Frame frame ; ontainer conte nt ; / / Label la belflightno ; Label la belflightdate ; / / / / JTex tfield tex tflightno ; JTex tfield tex tflightdate ; / / JLabel labelmessage; JButton but tonsubmit ; GridBagLayout gl ; GridBagConstraints gbc; public Fligh tinfo( ) frame = new JFrame( ) ; frame.setsize(400,400) ; frame.setvisible(true) ;

93 74 Java gl = new GridBagLayout( ) ; gbc = new GridBagConstr ain ts( ) ; conte nt = frame.getcon tentpane( ) ; content.setlayout(gl) ; / / labelflightno = new JLabel( ) ; labelflightdate = new JLabel( ) ; / / / / tex tflightno = new JTex tfield( 5) ; tex tflightdate = new JTe xtfield(10) ; / / labelmessage = new JLabel( ) ; but tonsubmit = new JBut ton( ) ; / / gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 5 ; gl.setconstraints( labelflightno, gbc) ; content.add( labelflightno) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 4 ; gbc.gridy = 5 ; gl.setconstraints( textflightno, gbc) ; content.add( textflightno) ; gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 1 ; gbc.gridy = 8 ; gl.setconstraints( labelflightdate,gbc) ; content.add( labelflightdate) ; / / gbc.anchor = GridBagConst raints.no R T HWEST ; gbc.gridx = 8 ; gbc.gridy = 32 ;

94 75 gl.setconstraints( but tonsubmit, gbc) ; content.add( but tonsubmit) ; / / validatelistener validate = new validatelistener( ) ; buttonsubmit.addactionlistener(validate) ; gbc.anchor = GridBagConstraints.NORTHWEST; gbc.gridx = 4; gbc.gridy = 36 ; gl.setconstraints( labelmessage,gbc) ; content.add(labelmessage) ; / / class validatelistener implements ActionListener public void actionperformed( ActionEvent event) / / JButton source = (JButton) event.getsource( ) ; if( source = = buttonsubmit) String strno = textflightno.gettext( ) ; String strdate = textflightdate.gettext( ) ; String strfrom = textflightfrom.gettext( ) ; String strto = textflightto.gettext( ) ; String strstarttime = textflightstarttime.gettext( ) ; String strendtime = textflightendtime.gettext( ) ; String strfirst = textflightfirstclassfare.gettext( ) ; String strbusiness = textflightbusinessclassfare.gettext( ) ; String streconomy = textflighteconomyclassfare.gettext( ) ; String strseatnum = textflightseatnum.gettext( ) ; if( strno.length( ) = = 0) labelmessage.settext( ) ; return; if( strdate.length( ) = = 0) labelmessage.settext( ) ;

95 76 Java return; if(strfrom.length( ) = = 0 ) labelmessage.settext( ) ; return; if( strto.length( ) = = 0) labelmessage.settext( ) ; return; if(strstarttime.length( ) = = 0 ) labelmessage.settext( ) ; return; if( strendtime.length( ) = = 0) labelmessage.settext( ) ; return; if (strfirst.length( ) = = 0 ) labelmessage.settext( ) ; return; if (strbusiness.length( ) = = 0 ) labelmessage.settext( ) ; return; if (streconomy.length( ) = = 0 ) labelmessage.settext( ) ; return; if (strseatnum.length( ) = = 0 )

96 77 labelmessage.settext( ) ; return; / / double doufirstclassfare = new Double( strfirst).doublevalue( ) ; double doubusinessclassfare = new Double( strbusiness).doublevalue( ) ; double doueconomyclassfare = new Double( streconomy).doublevalue( ) ; int intseatnum = Integer.parseInt( strseatnum) ; if( doufirstclassfare < = 0) labelmessage.settext( ) ; return; if( doubusinessclassfare < = 0 ) labelmessage.settext( ) ; return; if( doueconomyclassfare < = 0) labelmessage.settext( ) ; return; if( intseatnum < = 0 ) labelmessage.settext( ) ; return; public static void main( String[ ] args) FlightInfo obj = new FlightInfo( ) ; ( 5),

97 78 Java, : ; ; ( MouseEvent), MOUSE _CLICKED( ) MO USE_ DRA GGED ( )MO USE _ ENTERED( ) MOUSE _ EXI TED ( ) MO USE_MOU VED( )MO USE_ PRESS ED( )MOU SE_ RELEASED( ),,,, x y, / / MouseT est.java import java.awt. * ; import java.awt.event.* ; import javax.swing.* ; public class Mouse Test extends JF rame int x,y ; JPanel panel ; JLa bel labelx, labely; JTextField textx, texty ; JTextField text1, text2; public Mouse Test ( ) panel = new JPanel( ) ; labelx = new JLabel( X: ) ; labely = new JLabel( Y : ) ; textx = new J TextField( 3) ;

98 79 texty = new JTextField(3 ) ; text1 = new JTextField(8 ) ; text2 = new JTextField(5 ) ; getcontent Pane( ).add( panel) ; panel.add(labelx) ; panel.add( textx) ; panel.add(labely) ; panel.add( texty ) ; panel.add( text1) ; panel.add( text2) ; / / add MouseListener( new T estmouselistener ( ) ) ; add MouseMotionListene r( new TestMovedListene r( ) ) ; / / class TestMouseListen er implements MouseListener public void mouseclicked( MouseEvent event) text1.set Text(Mouse Click ) ; / / public void mousep ressed( MouseEvent event) public void mouseen tered( MouseEven t event) text2.set Text( Come in ) ; / / public void mouseexited( MouseE vent eve nt) public void mousereleased( MouseE vent even t) / / class TestMovedListene r implemen ts MouseMo tionlistene r

99 80 Java public void mousemoved( MouseEvent evt) x = evt.getx( ) ; y = evt.gety ( ) ; textx.sett ext( String.valueOf( x) ) ; texty.set Text( String.valueOf( y) ) ; public void mousedr agged( MouseEven t event) public static void main( String args[ ] ) MouseT est mousexy = new Mouse Test( ) ; mousexy.setsize(400,150) ; mousexy.s how ( ) ; : ( 1) ; ( 2) MouseListener, Mou semotionlist ener ; ( 3) MouseListener mouseclicked,, Mouse Click, mouseentered,, Come in ; ( 4 ) MouseMotionListener mousemoved, MouseEvent getx Y X Y

100 ( KeyEvent) : KEY_ PR ESSED ( ), KEY_ RELEAS ED( ) KEY_PRESSED KEY_ R ELEASED,, Java KEY_TYP ED( ), , JF rame,, : 2.,,,,,,, Java,, 3. ( 1) H H : MM; ( 2) keylistener keypressed keyreleased K eyevent key Typed, keytyped,, KeyEvent get KeyCode( )(KeyCode) ( 3) (,, ) import javax.swing.* ; import java.awt. * ; import java.applet. * ;

101 82 Java public clas s Fligh tinfo JF rame frame ; Container con tent ; / / JLabel labelflightno; JLa bel labelfligh tda te; / / / / JTextField textflight No ; JTex tfield tex tflightdate ; / / JLabel labelmessage; JButton but tonsubmit ; GridBagLayout gl ; GridBagConst rain ts gbc; public Fligh tinfo( ) frame = new JF rame( ) ; frame.setsize(400,400) ; frame.setvisible( true) ; gl = new GridBagLayout( ) ; gbc = n ew GridBagConst rain ts( ) ; conte nt = frame.getcon tentpan e( ) ; content.setlayout(gl) ; / / labelflightno = new JLabel( ) ; labelflightdate = new JLabel( ) ; / / / / tex tflightno = new JTex tfield (5) ; tex tflightdate = new JT extfield(10) ;

102 83 / / labelmessage = new JLabel( ) ; but tonsubmit = new JButton( ) ; / / gbc.anchor = GridBagConst raints.n OR T HWEST ; gbc.gridx = 1 ; gbc.gridy = 5 ; gl.setconstraints( labelflightno, gbc) ; conte nt.add( la belflightno) ; gbc.anchor = GridBagConst raints.n OR T HWEST ; gbc.gridx = 4 ; gbc.gridy = 5 ; gl.setconstraints( textflightno, gbc) ; conte nt.add( tex tflightno) ; gbc.anchor = GridBagConst raints.n OR T HWEST ; gbc.gridx = 1 ; gbc.gridy = 8 ; gl.setconstraints( labelflightdate,gbc) ; content.add( labelflightdate) ; / / gbc.anchor = GridBagConst raints.n OR T HWEST ; gbc.gridx = 4 ; gbc.gridy = 36 ; gl.setconstraints( labelmessage,gbc) ; content.add( labelmessage) ; / / keylistener listener = new keylistener( ) ; textflightfirstclassfare.addkeylistener( listener) ; textflightbusinessclassfare.addkeylistener(listener) ; textflighteconomyclassfare.addkeylistener(listener) ; textflightseatnum.addkeylistener(listener) ;

103 84 Java / / / / class keylistener extends KeyAdapter / /, public void keytyped( KeyEvent evt) / / JTextField text = ( JTextField) evt.getsource( ) ; if( text = = textflightseatnum) else if( evt.getkeychar( ) < = 0 evt.getkeychar( ) > = 9 ) return; labelmessage.settext( ) ; if( evt.getkeychar( ) < = 0 evt.getkeychar( ) > = 9 ) labelmessage.settext( ) ; return; public void keypressed( KeyEvent evt) public void keyreleased( KeyEvent evt) public static void main( String[ ] args ) FlightInfo obj = new FlightInfo( ) ;

104 85 : keylistener, keylistener, ( 4) ;,,,,, 4.3 ( 1) Java, Java, GUI, GUI, GUI, ( 2) GUI, : ()(), ( 3) Java, ( ) ( ), () ( 4) java.awt.event java.awt.event : ActionEvent Adjustment Event Ite mevent Text Event, : WindowEvent KeyEvent MouseEvent Component EventCont ainereventfocusevent ( 5),,

NIIT APP T ECH,,,,,, C++ : C++, C++,,, C++,,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) C++ /,,. :,2005.4 (21.) ISBN 7-302-10506-5. C..

NIIT APP T ECH,,,,,, C++ : C++, C++,,, C++,,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) C++ /,,. :,2005.4 (21.) ISBN 7-302-10506-5. C.. NIIT APP T ECH,,,,,, C++ : C++, C++,,, C++,,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) C++ /,,. :,2005.4 (21.) ISBN 7-302-10506-5. C.. C - - : -. T P312 CIP (2005 ) 011979 : : ht tp :/ /

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes (Swing) AWTEvent Font LayoutManager 1 Classes in the javax.swing package Heavyweight FontMetrics Object Color Panel Applet JApplet Graphics Component Container Window Frame JFrame * Dialog JDialog JComponent

More information

(CIP) Web /,. :,2005. 1 ISBN 7 81058 782 X.W............T P393.4 CIP (2004) 118797 Web ( 99 200436) ( http:/ / www.shangdapress.com 66135110) : * 787

(CIP) Web /,. :,2005. 1 ISBN 7 81058 782 X.W............T P393.4 CIP (2004) 118797 Web ( 99 200436) ( http:/ / www.shangdapress.com 66135110) : * 787 Web (CIP) Web /,. :,2005. 1 ISBN 7 81058 782 X.W............T P393.4 CIP (2004) 118797 Web ( 99 200436) ( http:/ / www.shangdapress.com 66135110) : * 787 1092 1/ 16 30.75 748 2005 1 1 2005 1 1 : 1 3 100

More information

Swing-02.pdf

Swing-02.pdf 2 J B u t t o n J T e x t F i e l d J L i s t B u t t o n T e x t F i e l d L i s t J F r a m e 21 2 2 Swing C a n v a s C o m p o n e n t J B u t t o n AWT // ToolbarFrame1.java // java.awt.button //

More information

2 Java 语 言 程 序 设 计 教 程 1.2.1 简 单 性 Java 语 言 的 语 法 与 C 语 言 和 C++ 语 言 很 接 近, 使 得 大 多 数 程 序 员 很 容 易 学 习 和 使 用 Java 另 一 方 面,Java 丢 弃 了 C++ 中 很 少 使 用 的 很 难

2 Java 语 言 程 序 设 计 教 程 1.2.1 简 单 性 Java 语 言 的 语 法 与 C 语 言 和 C++ 语 言 很 接 近, 使 得 大 多 数 程 序 员 很 容 易 学 习 和 使 用 Java 另 一 方 面,Java 丢 弃 了 C++ 中 很 少 使 用 的 很 难 第 1 章 Java 概 述 Java 的 诞 生 Java 的 特 点 Java 开 发 环 境 安 装 与 配 置 创 建 并 运 行 一 个 简 单 的 Java 程 序 Java 语 言 是 当 今 计 算 机 软 件 行 业 中 最 热 门 的 网 络 编 程 语 言, 以 Java 为 核 心 的 芯 片 技 术 编 译 技 术 数 据 库 连 接 技 术, 以 及 基 于 企 业 级

More information

Learning Java

Learning Java Java Introduction to Java Programming (Third Edition) Prentice-Hall,Inc. Y.Daniel Liang 2001 Java 2002.2 Java2 2001.10 Java2 Philip Heller & Simon Roberts 1999.4 Java2 2001.3 Java2 21 2002.4 Java UML 2002.10

More information

新・解きながら学ぶJava

新・解きながら学ぶJava 481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --

More information

基于CDIO一体化理念的课程教学大纲设计

基于CDIO一体化理念的课程教学大纲设计 Java 语 言 程 序 设 计 课 程 教 学 大 纲 Java 语 言 程 序 设 计 课 程 教 学 大 纲 一 课 程 基 本 信 息 1. 课 程 代 码 :52001CC022 2. 课 程 名 称 :Java 语 言 程 序 设 计 3. 课 程 英 文 名 称 :Java Programming 4. 课 程 类 别 : 理 论 课 ( 含 实 验 上 机 或 实 践 ) 5. 授

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes What is a JavaBean? JavaBean Java JavaBean Java JavaBean JComponent tooltiptext font background foreground doublebuffered border preferredsize minimumsize maximumsize JButton. Swing JButton JButton() JButton(String

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-065Big5 Title : Sun Certified Programmer for the Java 2 Platform, SE 6.0 Version : Demo 1 / 14 1. 35. String #name = "Jane Doe"; 36. int

More information

(京)新登字063号

(京)新登字063号 教 育 部 职 业 教 育 与 成 人 教 育 司 推 荐 教 材 Java 程 序 设 计 教 程 ( 第 二 版 ) 沈 大 林 主 编 沈 昕 肖 柠 朴 曾 昊 等 编 著 内 容 简 介 Java 是 由 美 国 SUN 公 司 开 发 的 一 种 功 能 强 大 的, 具 有 简 单 面 向 对 象 分 布 式 可 移 植 等 性 能 的 多 线 程 动 态 计 算 机 编 程 语 言

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Java application Java main applet Web applet Runnable Thread CPU Thread 1 Thread 2 Thread 3 CUP Thread 1 Thread 2 Thread 3 ,,. (new) Thread (runnable) start( ) CPU (running) run ( ) blocked CPU sleep(

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum

More information

Java 1 Java String Date

Java 1 Java String Date JAVA SCJP Java 1 Java String Date 1Java 01 Java Java 1995 Java Java 21 Java Java 5 1-1 Java Java 1990 12 Patrick Naughton C++ C (Application Programming Interface API Library) Patrick Naughton NeXT Stealth

More information

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题 2009 年 3 月 全 国 计 算 机 等 级 考 试 笔 试 试 卷 二 级 Java 语 言 程 序 设 计 ( 考 试 时 间 90 分 钟, 满 分 100 分 ) 一 选 择 题 ( 每 题 2 分, 共 70 分 ) 下 列 各 题 A) B) C) D) 四 个 选 项 中, 只 有 一 个 选 项 是 正 确 的 请 将 正 确 选 项 填 涂 在 答 题 卡 相 应 位 置 上,

More information

附录J:Eclipse教程

附录J:Eclipse教程 附 录 J:Eclipse 教 程 By Y.Daniel Liang 该 帮 助 文 档 包 括 以 下 内 容 : Eclipse 入 门 选 择 透 视 图 创 建 项 目 创 建 Java 程 序 编 译 和 运 行 Java 程 序 从 命 令 行 运 行 Java Application 在 Eclipse 中 调 试 提 示 : 在 学 习 完 第 一 章 后 使 用 本 教 程 第

More information

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6 www.brainysoft.net 1.JasperReport ireport...4 1.1 JasperReport...4 1.2 ireport...4 2....4 2.1 JDK...4 2.1.1 JDK...4 2.1.2 JDK...5 2.1.3 JDK...5 2.2 ant...6 2.2.1 ant...6 2.2.2 ant...6 2.3 JasperReport...7

More information

内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指

内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指 内 容 提 要 将 JAVA 开 发 环 境 迁 移 到 Linux 系 统 上 是 现 在 很 多 公 司 的 现 实 想 法, 而 在 Linux 上 配 置 JAVA 开 发 环 境 是 步 入 Linux 下 JAVA 程 序 开 发 的 第 一 步, 本 文 图 文 并 茂 地 全 程 指 导 你 搭 建 Linux 平 台 下 的 JAVA 开 发 环 境, 包 括 JDK 以 及 集

More information

( CIP ) /. :, ISBN G52 CIP ( 2004 ) : : : ( 8620) ( 8620) ( )

( CIP ) /. :, ISBN G52 CIP ( 2004 ) : : : ( 8620) ( 8620) ( ) ( CIP ) /. :, 2005. 2 ISBN 7-81079 - 492-2.... G52 CIP ( 2004 ) 135829 : : : ( 8620) 85226561 85226593 85221601 ( 8620) 85225284 85228291 85220602 ( ) : (8620) 85221583 ( ) 85223774 () : 510630 : ht tp

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

epub 61-2

epub 61-2 2 Web Dreamweaver UltraDev Dreamweaver 3 We b We b We Dreamweaver UltraDev We b Dreamweaver UltraDev We b We b 2.1 Web We b We b D r e a m w e a v e r J a v a S c r i p t We b We b 2.1.1 Web We b C C +

More information

FY.DOC

FY.DOC 高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主

More information

Microsoft Word - 第3章.doc

Microsoft Word - 第3章.doc Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck

More information

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii

前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii 前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii C# 7 More Effective C# C# C# C# C# C# Common Language Runtime CLR just-in-time

More information

java2d-4.PDF

java2d-4.PDF 75 7 6 G r a d i e n t P a i n t B a s i c S t r o k e s e t P a i n t ( ) s e t S t o r k e ( ) import java.awt.*; import java.awt.geom.*; public class PaintingAndStroking extends ApplicationFrame { public

More information

ebook

ebook 26 JBuilder RMI Java Remote Method Invocation R M I J a v a - - J a v a J a v J a v a J a v a J a v a R M I R M I ( m a r s h a l ) ( u n m a r c h a l ) C a ff e i n e J a v a j a v a 2 i i o p J a v

More information

untitled

untitled OGRE http://antsam.blogone.net AntsamCGD@hotmail.com OGRE OGRE listener listener target listener target Dispatcher Processor Input Reader Event class view Event Class view Input Event ctrlaltshift ascoll

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

ZW1.PDF

ZW1.PDF C. A. R. Hoare, The Emperor s Old Clothes Java C++ Objective C Eiffel Smalltalk Mesa Lisp Java Java Java C++ Java 10 Item 1 Item 2 String.equals() == 1 1 Item 3 Java C++ Java Item 4 Java Item 5 Java Item

More information

D C 93 2

D C 93 2 D9223468 3C 93 2 Java Java -- Java UML Java API UML MVC Eclipse API JavadocUML Omendo PSPPersonal Software Programming [6] 56 8 2587 56% Java 1 epaper(2005 ) Java C C (function) C (reusability) eat(chess1,

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

More information

Microsoft PowerPoint - ch6 [相容模式]

Microsoft PowerPoint - ch6 [相容模式] UiBinder wzyang@asia.edu.tw UiBinder Java GWT UiBinder XML UI i18n (widget) 1 2 UiBinder HelloWidget.ui.xml: UI HelloWidgetBinder HelloWidget.java XML UI Owner class ( Composite ) UI XML UiBinder: Owner

More information

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit Tomcat Web JUnit Cactus JUnit Java Cactus JUnit 26.1 JUnit Java JUnit JUnit Java JSP Servlet JUnit Java Erich Gamma Kent Beck xunit JUnit boolean JUnit Java JUnit Java JUnit Java 26.1.1 JUnit JUnit How

More information

RunPC2_.doc

RunPC2_.doc PowerBuilder 8 (5) PowerBuilder Client/Server Jaguar Server Jaguar Server Connection Cache Thin Client Internet Connection Pooling EAServer Connection Cache Connection Cache Connection Cache Connection

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-055Big5 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : Demo 1 / 22 1. 11. public static void parse(string str)

More information

untitled

untitled 1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 ives.net@gmail.com www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立

More information

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入 100 年 特 種 考 試 地 方 政 府 公 務 人 員 考 試 試 題 等 別 : 三 等 考 試 類 科 : 資 訊 處 理 科 目 : 系 統 分 析 與 設 計 一 請 參 考 下 列 旅 館 管 理 系 統 的 使 用 案 例 圖 (Use Case Diagram) 撰 寫 預 約 房 間 的 使 用 案 例 規 格 書 (Use Case Specification), 繪 出 入

More information

3.1 num = 3 ch = 'C' 2

3.1 num = 3 ch = 'C' 2 Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:

More information

因 味 V 取 性 又 鸟 U 且 最 大 罗 海 惜 梅 理 春 并 贵 K a t h l ee n S c h w e r d t n er M f l e z S e b a s t i a n C A Fe rs e T 民 伊 ' 国 漳 尤 地 视 峰 州 至 周 期 甚 主 第 应

因 味 V 取 性 又 鸟 U 且 最 大 罗 海 惜 梅 理 春 并 贵 K a t h l ee n S c h w e r d t n er M f l e z S e b a s t i a n C A Fe rs e T 民 伊 ' 国 漳 尤 地 视 峰 州 至 周 期 甚 主 第 应 国 ' 东 极 也 直 前 增 东 道 台 商 才 R od e ric h P t ak 略 论 时 期 国 与 东 南 亚 的 窝 贸 易 * 冯 立 军 已 劳 痢 内 容 提 要 国 与 东 南 亚 的 窝 贸 易 始 于 元 代 代 大 规 模 开 展 的 功 效 被 广 为 颂 扬 了 国 国 内 市 场 窝 的 匮 乏 窝 补 虚 损 代 上 流 社 会 群 体 趋 之 若 鹜 食 窝

More information

untitled

untitled JavaEE+Android - 6 1.5-2 JavaEE web MIS OA ERP BOSS Android Android Google Map office HTML CSS,java Android + SQL Sever JavaWeb JavaScript/AJAX jquery Java Oracle SSH SSH EJB+JBOSS Android + 1. 2. IDE

More information

XXXXXXXX http://cdls.nstl.gov.cn 2 26

XXXXXXXX http://cdls.nstl.gov.cn 2 26 [ ] [ ] 2003-7-18 1 26 XXXXXXXX http://cdls.nstl.gov.cn 2 26 (2003-7-18) 1...5 1.1...5 1.2...5 1.3...5 2...6 2.1...6 2.2...6 2.3...6 3...7 3.1...7 3.1.1...7 3.1.2...7 3.1.2.1...7 3.1.2.1.1...8 3.1.2.1.2...10

More information

JavaIO.PDF

JavaIO.PDF O u t p u t S t ream j a v a. i o. O u t p u t S t r e a m w r i t e () f l u s h () c l o s e () public abstract void write(int b) throws IOException public void write(byte[] data) throws IOException

More information

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc

Microsoft Word - 97.01.30軟體設計第二部份範例試題_C++_ _1_.doc 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 範 例 試 題 (C++) 試 題 編 號 :11900-920201-4 審 定 日 期 : 94 年 7 月 1 日 修 訂 日 期 : 96 年 2 月 1 日 97 年 1 月 30 日 ( 第 二 部 份 ) 電 腦 軟 體 設 計 乙 級 技 術 士 技 能 檢 定 術 科 測 試 應 檢 參 考 資 料 壹 試

More information

基于ECO的UML模型驱动的数据库应用开发1.doc

基于ECO的UML模型驱动的数据库应用开发1.doc ECO UML () Object RDBMS Mapping.Net Framework Java C# RAD DataSetOleDbConnection DataGrod RAD Client/Server RAD RAD DataReader["Spell"].ToString() AObj.XXX bug sql UML OR Mapping RAD Lazy load round trip

More information

Persuasive Techniques (motorcycle helmet)

Persuasive Techniques  (motorcycle helmet) M O D E A T H E E L E M E N T S O F A N A R G U M E N T 1n t h l s t e s t i m o n y g iv e n b e f o r e t h e M a ry l a n d Se n a t e t h e s p e a ke r m a ke s a s t r o n g c l a i m a b o u t t

More information

VB程序设计教程

VB程序设计教程 高 等 学 校 教 材 Visual Basic 程 序 设 计 教 程 魏 东 平 郑 立 垠 梁 玉 环 石 油 大 学 出 版 社 内 容 提 要 本 书 是 按 高 等 学 校 计 算 机 程 序 设 计 课 程 教 学 大 纲 编 写 的 大 学 教 材, 主 要 包 括 VB 基 础 知 识 常 用 程 序 结 构 和 算 法 Windows 用 户 界 面 设 计 基 础 文 件 处

More information

Java的详细介绍

Java的详细介绍 Java 的 详 细 介 绍 出 处 : 站 长 百 科 原 文 地 址 :http://www.zzbaike.com/wiki/java 简 介 Java 的 详 细 介 绍...1 背 景...2 Java 语 言 对 软 件 开 发 技 术 的 影 响...4 工 业 界 对 Java 语 言 的 评 价...5 Java 语 言 的 应 用 前 景...6 Java 的 特 点...7 Java

More information

(HMI) IO A

(HMI) IO A 6.5 6.5 (HMI) IO 6.52 6.52 6.5 2007 113 A 602 100086 010 82616619 010 62638166 www.kingview.com 4 7 25 38 43 52 63 68 86 SQL 95 99 WEB 105 Web Web Web I/O Microsoft Windows XP/NT/2000 I/O PLC PLC PLC PLC

More information

PowerPoint 簡報

PowerPoint 簡報 Paint 繪圖板 JAVA 程式設計 指導老師 : 鄞宗賢 組員 : 4A3G0901 劉彥佐 4A3G0907 韓偉志 畫面預覽 匯入參數 package paint; import java.awt.*; import java.awt.event.*; import javax.swing.*; 主程式 public class paint{ public static void main(string[]

More information

untitled

untitled -JAVA 1. Java IDC 20 20% 5 2005 42.5 JAVA IDC JAVA 60% 70% JAVA 3 5 10 JAVA JAVA JAVA J2EE J2SE J2ME 70% JAVA JAVA 20 1 51 2. JAVA SUN JAVA J2EE J2EE 3. 1. CSTP CSTP 2 51 2. 3. CSTP IT CSTP IT IT CSTP

More information

Mac Java import com.apple.mrj.*;... public class MyFirstApp extends JFrame implements ActionListener, MRJAboutHandler, MRJQuitHandler {... public MyFirstApp() {... MRJApplicationUtils.registerAboutHandler(this);

More information

untitled

untitled 1 Outline 類别 欄 (1) 類 類 狀 更 易 類 理 若 類 利 來 利 using 來 namespace 類 ; (2) namespace IBM class Notebook namespace Compaq class Notebook 類别 類 來 類 列 欄 (field) (property) (method) (event) 類 例 立 來 車 類 類 立 車 欄 料

More information

untitled

untitled 1 行 行 行 行.NET 行 行 類 來 行 行 Thread 類 行 System.Threading 來 類 Thread 類 (1) public Thread(ThreadStart start ); Name 行 IsAlive 行 行狀 Start 行 行 Suspend 行 Resume 行 行 Thread 類 (2) Sleep 行 CurrentThread 行 ThreadStart

More information

上海市教育考试院关于印发新修订的

上海市教育考试院关于印发新修订的 沪 教 考 院 社 考 2012 7 号 上 海 市 教 育 考 试 院 关 于 印 发 上 海 市 高 等 学 校 计 算 机 等 级 考 试 大 纲 (2012 年 修 订 ) 的 通 知 各 有 关 高 校 : 为 进 一 步 加 强 本 市 高 校 计 算 机 基 础 教 学 工 作, 推 进 学 校 更 加 科 学 合 理 地 设 置 计 算 机 基 础 课 程 及 安 排 教 学 内 容,

More information

EJB-Programming-3.PDF

EJB-Programming-3.PDF :, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client

More information

没 有 多 余 的 Contruol 或 Action 了 原 来 Domain 层 被 服 务 层 Service layer 遮 挡, 在 右 边 图 中, 则 Domain 层 直 接 暴 露 给 前 台 了, 没 有 被 遮 挡, 裸 露 了 这 样 一 步 到 位 实 现 领 域 模 型

没 有 多 余 的 Contruol 或 Action 了 原 来 Domain 层 被 服 务 层 Service layer 遮 挡, 在 右 边 图 中, 则 Domain 层 直 接 暴 露 给 前 台 了, 没 有 被 遮 挡, 裸 露 了 这 样 一 步 到 位 实 现 领 域 模 型 文 章 编 号 :1007-757X(2012)1-0036-04 领 域 驱 动 模 型 的 WEB 软 件 系 统 设 计 研 究 摘 要 : J2EE 3 JDK1.7 Tomcat WEB 关 键 词 : 中 图 分 类 号 :TP311 文 献 标 志 码 :A 0 引 言 Web 软 件 系 统 的 分 层 结 构 典 型 的 J2EE 软 件 系 统 开 发 方 法 分 为 三 层 结

More information

untitled

untitled PowerBuilder Tips 利 PB11 Web Service 年度 2 PB Tips PB9 EAServer 5 web service PB9 EAServer 5 了 便 web service 來說 PB9 web service 力 9 PB11 release PB11 web service 力更 令.NET web service PB NVO 論 不 PB 來說 說

More information

利用Java技术编写桌面软件基础

利用Java技术编写桌面软件基础 利 用 Java 技 术 编 写 桌 面 软 件 基 础 在 学 习 Java 编 程 语 言 的 细 节 和 语 法 时, 我 们 会 碰 到 这 样 一 个 问 题 : 开 发 桌 面 应 用 软 件 需 要 使 用 哪 些 Java 技 术, 应 当 引 入 哪 些 package? 这 一 问 题 的 答 案 取 决 于 开 发 的 应 用 软 件 类 型 和 它 的 作 用 这 篇 文 章

More information

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj

Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj Message Transition 5-1 5-2 DataInputStream Class 5-3 DataOutputStream Class 5-4 PrintStream Class 5-5 (Message Transition) (Exercises) Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream

More information

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B 25 9 2008 9 M ICROEL ECTRON ICS & COMPU TER Vol. 25 No. 9 September 2008 J ava 1,2, 1,2, 1,2 (1, 330022 ; 2, 330022) :,. Apla - Java,,.. : PAR ;Apla - Java ; ;CMP ; : TP311 : A : 1000-7180 (2008) 09-0018

More information

基于UML建模的管理管理信息系统项目案例导航——VB篇

基于UML建模的管理管理信息系统项目案例导航——VB篇 PowerBuilder 8.0 PowerBuilder 8.0 12 PowerBuilder 8.0 PowerScript PowerBuilder CIP PowerBuilder 8.0 /. 2004 21 ISBN 7-03-014600-X.P.. -,PowerBuilder 8.0 - -.TP311.56 CIP 2004 117494 / / 16 100717 http://www.sciencep.com

More information

untitled

untitled 51testing www.51testing.com UML Java Unified Modeling Language UML 1 UML 2 UML UML UML UML UML UML use case Java 1 2 3 4( 5 6 7 UNIX Windows OS/2 ( GUI ) 8 51testing www.51testing.com use caseactor ()

More information

<ADB6ADB1C25EA8FAA6DB2D4D56432E706466>

<ADB6ADB1C25EA8FAA6DB2D4D56432E706466> packages 3-31 PART 3-31 03-03 ASP.NET ASP.N MVC ASP.NET ASP.N MVC 4 ASP.NET ASP.NE MVC Entity Entity Framework Code First 2 TIPS Visual Studio 20NuGetEntity NuGetEntity Framework5.0 CHAPTER 03 59 3-3-1

More information

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, http://debut.cis.nctu.edu.tw/~chi Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, : POSITIVE_INFINITY NEGATIVE_INFINITY

More information

,,,,,,,,,,,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /. :,2005.2 (21. ) ISBN 7-302-10172-8... - : -. F713.36 CIP (2004 ) 135971 : : ht

,,,,,,,,,,,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /. :,2005.2 (21. ) ISBN 7-302-10172-8... - : -. F713.36 CIP (2004 ) 135971 : : ht 1 ,,,,,,,,,,,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /. :,2005.2 (21. ) ISBN 7-302-10172-8... - : -. F713.36 CIP (2004 ) 135971 : : ht tp :/ / www.tup.com.cn : 100084 : 010-62770175 :

More information

附表2:

附表2: 广 东 省 精 品 资 源 共 享 课 程 推 荐 表 ( 高 职 ) 课 程 学 校 清 远 职 业 技 术 学 院 课 程 名 称 数 据 库 应 用 技 术 课 程 类 型 公 共 基 础 课 专 业 课 其 他 所 属 专 业 大 类 名 称 所 属 专 业 类 名 称 电 子 信 息 计 算 机 所 属 专 业 名 称 ( 专 业 课 填 写 ) 计 算 机 应 用 技 术 课 程 负 责

More information

UNIX Shell Shell UNIX, 21 UN IX, UNIX UNIX UNIX vi UNIX UNIX Shell, UNIX Shell Shell UNIX Shell, Shell Shell Shell Shell Shell UNIX, (CIP) UNIX Shell

UNIX Shell Shell UNIX, 21 UN IX, UNIX UNIX UNIX vi UNIX UNIX Shell, UNIX Shell Shell UNIX Shell, Shell Shell Shell Shell Shell UNIX, (CIP) UNIX Shell UNIX Shell UNIX Shell Shell UNIX, 21 UN IX, UNIX UNIX UNIX vi UNIX UNIX Shell, UNIX Shell Shell UNIX Shell, Shell Shell Shell Shell Shell UNIX, (CIP) UNIX Shell /,. :,2003.12 ISBN 7 5612 1721 8. U.. U

More information

软件概述

软件概述 Cobra DocGuard BEIJING E-SAFENET SCIENCE & TECHNOLOGY CO.,LTD. 2003 3 20 35 1002 010-82332490 http://www.esafenet.com Cobra DocGuard White Book 1 1....4 1.1...4 1.2 CDG...4 1.3 CDG...4 1.4 CDG...5 1.5

More information

Windows XP

Windows XP Windows XP What is Windows XP Windows is an Operating System An Operating System is the program that controls the hardware of your computer, and gives you an interface that allows you and other programs

More information

Topic

Topic 二 级 JAVA 上 机 试 题 汇 编 第 01 套 : 1. 基 本 操 作 (1 小 题, 计 30 分 ) 在 考 生 文 件 夹 中 存 有 文 件 名 为 Java_1.java 的 文 件, 该 程 序 是 不 完 整 的, 请 在 注 释 行 //**********Found********** 下 一 行 语 句 的 下 划 线 地 方 填 入 正 确 内 容, 然 后 删 除

More information

CHAPTER 1

CHAPTER 1 CHAPTER 1 1-1 System Development Life Cycle; SDLC SDLC Waterfall Model Shelly 1995 1. Preliminary Investigation 2. System Analysis 3. System Design 4. System Development 5. System Implementation and Evaluation

More information

提问袁小兵:

提问袁小兵: C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.

More information

javaexample-02.pdf

javaexample-02.pdf n e w. s t a t i c s t a t i c 3 1 3 2 p u b l i c p r i v a t e p r o t e c t e d j a v a. l a n g. O b j e c t O b j e c t Rect R e c t x 1 y 1 x 2 y 2 R e c t t o S t r i n g ( ) j a v a. l a n g. O

More information

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM CHAPTER 6 SQL SQL SQL 6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM 3. 1986 10 ANSI SQL ANSI X3. 135-1986

More information

C/C++ - 文件IO

C/C++ - 文件IO C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;

More information

(Microsoft Word - \272\364\263q\245|\244A_49636107_\304\254\253\330\336\263__\272\353\302\262\263\370\247i.doc)

(Microsoft Word - \272\364\263q\245|\244A_49636107_\304\254\253\330\336\263__\272\353\302\262\263\370\247i.doc) SCJP (Oracle Certified Professional, Java SE5/6 Programmer) 學 制 / 班 級 : 四 年 制 / 網 通 四 乙 指 導 老 師 : 方 信 普 老 師 學 生 學 號 / 姓 名 : 49636107 蘇 建 瑋 繳 交 年 份 : 100 年 6 月 一 SCJP 介 紹 SCJP 是 Sun Certified Java Programmer

More information

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 JAVA 程 序 设 计 ( 肆 ) 徐 东 / 数 学 系 使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 使 用 Java class 代 表 保 险 箱 public class SaveBox 类 名 类 类 体 实 现 封 装 性 使 用 class SaveBox 代 表 保

More information

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco

Windows RTEMS 1 Danilliu MMI TCP/IP QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos eco Windows RTEMS 1 Danilliu MMI TCP/IP 80486 QEMU i386 QEMU ARM POWERPC i386 IPC PC104 uc/os-ii uc/os MMI TCP/IP i386 PORT Linux ecos Linux ecos ecos ecos Email www.rtems.com RTEMS ecos RTEMS RTEMS Windows

More information

C/C++ - 字符输入输出和字符确认

C/C++ - 字符输入输出和字符确认 C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,

More information

TX-NR3030_BAS_Cs_ indd

TX-NR3030_BAS_Cs_ indd TX-NR3030 http://www.onkyo.com/manual/txnr3030/adv/cs.html Cs 1 2 3 Speaker Cable 2 HDMI OUT HDMI IN HDMI OUT HDMI OUT HDMI OUT HDMI OUT 1 DIGITAL OPTICAL OUT AUDIO OUT TV 3 1 5 4 6 1 2 3 3 2 2 4 3 2 5

More information

untitled

untitled 1 .NET 利 [] [] 來 說 切 切 理 [] [ ] 來 說 拉 類 類 [] [ ] 列 連 Web 行流 來 了 不 不 不 流 立 行 Page 類 Load 理 Response 類 Write 料 Redirect URL Response.Write("!! ives!!"); Response.Redirect("WebForm2.aspx"); (1) (2) Web Form

More information

软 件 工 程 专 业 习 指 南 目 录 一 软 件 工 程 专 业 设 置 背 景 与 发 展 前 景... 3 二 软 件 工 程 专 业 实 践 教 条 件... 4 三 软 件 工 程 专 业 课 程 类 型 及 核 方 式... 6 1. 软 件 工 程 专 业 课 程 类 型...7

软 件 工 程 专 业 习 指 南 目 录 一 软 件 工 程 专 业 设 置 背 景 与 发 展 前 景... 3 二 软 件 工 程 专 业 实 践 教 条 件... 4 三 软 件 工 程 专 业 课 程 类 型 及 核 方 式... 6 1. 软 件 工 程 专 业 课 程 类 型...7 计 算 机 系 软 件 工 程 专 业 习 指 南 广 东 科 技 院 计 算 机 系 2015-9-1 软 件 工 程 专 业 习 指 南 目 录 一 软 件 工 程 专 业 设 置 背 景 与 发 展 前 景... 3 二 软 件 工 程 专 业 实 践 教 条 件... 4 三 软 件 工 程 专 业 课 程 类 型 及 核 方 式... 6 1. 软 件 工 程 专 业 课 程 类 型...7

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

多層次傳銷與獎金系統

多層次傳銷與獎金系統 醒 吾 技 術 學 院 資 訊 管 理 系 ( 五 專 部 ) 九 十 六 學 年 度 畢 業 專 題 多 層 次 傳 銷 與 獎 金 系 統 組 員 : 921506122 游 濬 瑋 921506126 陳 彥 宇 921506139 林 龍 華 921506144 陳 昶 志 921506149 楊 璧 如 指 導 老 師 : 汪 淵 老 師 中 華 民 國 九 十 七 年 一 月 十 一 醒

More information

Eclipse C C++, or

Eclipse C C++,  or Eclipse C C++, Emailctchen@pl.csie.ntut.edu.tw or s1669021@ntut.edu.tw, s2598003@ntut.edu.tw http://pl.csie.ntut.edu.tw/~ctchen, http://www.ntut.edu.tw/~s2598003/ 2004/9/10 (0.02 ) Eclipse http://www.eclipse.org

More information

声 明 本 公 司 及 全 体 董 事 监 事 高 级 管 理 人 员 承 诺 不 存 在 任 何 虚 假 记 载 误 导 性 陈 述 或 重 大 遗 漏, 并 对 其 真 实 性 准 确 性 完 整 性 承 担 个 别 和 连 带 的 法 律 责 任 本 公 司 负 责 人 和 主 管 会 计 工

声 明 本 公 司 及 全 体 董 事 监 事 高 级 管 理 人 员 承 诺 不 存 在 任 何 虚 假 记 载 误 导 性 陈 述 或 重 大 遗 漏, 并 对 其 真 实 性 准 确 性 完 整 性 承 担 个 别 和 连 带 的 法 律 责 任 本 公 司 负 责 人 和 主 管 会 计 工 Shenzhen WitSoft Information Technology Co., Ltd. 主 办 券 商 二 〇 一 六 年 二 月 声 明 本 公 司 及 全 体 董 事 监 事 高 级 管 理 人 员 承 诺 不 存 在 任 何 虚 假 记 载 误 导 性 陈 述 或 重 大 遗 漏, 并 对 其 真 实 性 准 确 性 完 整 性 承 担 个 别 和 连 带 的 法 律 责 任 本

More information

Chapter 2

Chapter 2 2 (Setup) ETAP PowerStation ETAP ETAP PowerStation PowerStation PowerPlot ODBC SQL Server Oracle SQL Server Oracle Windows SQL Server Oracle PowerStation PowerStation PowerStation PowerStation ETAP PowerStation

More information

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與

第 15 章 程 式 編 写 語 言 15.1 程 式 編 写 語 言 的 角 色 程 式 編 寫 語 言 是 程 式 編 寫 員 與 電 腦 溝 通 的 界 面 語 法 是 一 組 規 則 讓 程 式 編 寫 員 將 字 詞 集 合 起 來 電 腦 是 處 理 位 元 和 字 節 的 機 器, 與 程 式 編 写 語 言 在 完 成 這 章 後, 你 將 能 夠 了 解 程 式 編 写 語 言 的 功 能 了 解 高 階 語 言 和 低 階 語 言 之 間 的 分 別 知 道 翻 譯 程 式 的 意 義 和 能 夠 把 翻 譯 程 式 分 類 為 : 匯 編 程 式 編 譯 程 式 和 解 譯 程 式 認 識 不 同 翻 譯 程 式 的 優 點 和 缺 點 程 式 是 指 揮 電 腦 的 指

More information

(CIP) /. :,2005 ( /, ) ISBN R247.1 TS CIP (2005) ( ht tp : / / www. tcmonline. com. cn ) ( ) 787 mm

(CIP) /. :,2005 ( /, ) ISBN R247.1 TS CIP (2005) ( ht tp : / / www. tcmonline. com. cn ) ( ) 787 mm (CIP) /. :,2005 ( /, ) ISBN 7 81010 910 3.......... R247.1 TS927.161 CIP (2005) 105125 ( ht tp : / / www. tcmonline. com. cn ) ( 1200 201203 ) 787 mm 1092 mm 1/ 32 8.375 182 1 4 100 2005 11 1 2005 11 1

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

PowerPoint Presentation

PowerPoint Presentation Visual Basic 2005 學 習 範 本 第 7 章 陣 列 的 活 用 7-1 陣 列 當 我 們 需 要 處 理 資 料 時, 都 使 用 變 數 來 存 放 資 料 因 為 一 個 變 數 只 能 代 表 一 個 資 料, 若 需 要 處 理 100 位 同 學 的 成 績 時, 便 要 使 用 100 個 不 同 的 變 數 名 稱, 這 不 但 會 增 加 變 數 名 稱 命 名

More information

Microsoft PowerPoint - course2.ppt

Microsoft PowerPoint - course2.ppt Java 程 式 設 計 基 礎 班 (2) 莊 坤 達 台 大 電 信 所 網 路 資 料 庫 研 究 室 Email: doug@arbor.ee.ntu.edu.tw Class 2 1 回 顧 Eclipse 使 用 入 門 Class 2 2 Lesson 2 Java 程 式 語 言 介 紹 Class 2 3 Java 基 本 知 識 介 紹 大 小 寫 有 差 (Case Sensitive)

More information

untitled

untitled How to using M-Power Report API M-Power Report API 力 了 M-Power Report -- Java (Library) M-Power Report API 行 Java M-Power Report M-Power Report API ( 30 ) PDF/HTML/CSV/XLS JPEG/PNG/SVG 料 料 OutputStream

More information

untitled

untitled 1 LinkButton LinkButton 連 Button Text Visible Click HyperLink HyperLink 來 立 連 Text ImageUrl ( ) NavigateUrl 連 Target 連 _blank _parent frameset _search _self 連 _top 例 sample2-a1 易 連 private void Page_Load(object

More information

IoC容器和Dependency Injection模式.doc

IoC容器和Dependency Injection模式.doc IoC Dependency Injection /Martin Fowler / Java Inversion of Control IoC Dependency Injection Service Locator Java J2EE open source J2EE J2EE web PicoContainer Spring Java Java OO.NET service component

More information

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2

(Guangzhou) AIT Co, Ltd V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn Xi III Zebra XI III 1 (Guangzhou) AIT Co, Ltd 020-84106666 020-84106688 http://wwwlenxcn 230V 110V [ ]! 2 (Guangzhou) AIT Co, Ltd 020-84106666

More information

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File

1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File 51 C 51 51 C C C C C C * 2003-3-30 pnzwzw@163.com C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test

More information