giáo trình java với eclipse

Giáo trình java gửi với Swing phần 2

Giáo trình java gửi với Swing phần 2

... Trang 1Giáo trình JavaBài 4: Bố trí các thành phần bên trong các đối tượng chứa Bài học này sẽ hướng dẫn bạn cách quản lý việc bày trí mà Java Platform cung cấp, ... các qui tắc tổng quan và chi tiết lệnh trong việc sử dụng việc quản lý bố trí mà Java platform cung cấp a.Sử dụng Layout Managers Sử dụng BorderLayout Sau đây là một Applet ... đoạn mã ví dụ cho phương thức trên: //Where the container is initialized: Trang 2Giáo trình Java //Put the Choice in a Panel to get a nicer look Panel cp = new Panel(); Choice c = new

Ngày tải lên: 03/10/2013, 13:20

35 774 3
Giáo trình Java P9

Giáo trình Java P9

... rotate(), move() và setColor() „ Các thao tác đó đối với một đối tượng hợp thành sử dụng một vòng lặp ‘for all’ „ Thao tác thực hiện ngay cả với trường hợp thành phần của Composite lại là một Composite ... thuật toán, cho phép thay đổi động cấu hình của đối tượng Trang 25Abstract Factory„ Một chương trình cần có khả năng chọn một trong một vài họ các lớp đối tượng „ Ví dụ, giao diện đồ họa nên ... MotifScrollBar, MotifWindow pmButton, pmScrollBar, pmWindow Trang 26Yêu cầu„ Thống nhất thao tác với mọi đối tượng: button, window, … Dễ dàng - định nghĩa giao diện (interfaces): „ Thống nhất

Ngày tải lên: 27/10/2013, 16:15

48 331 1
giáo trình Java By Example phần 9 ppt

giáo trình Java By Example phần 9 ppt

... both the MyThread.java and ThreadApplet2.java files in your CLASSES folder Java will then compile both files when you compile ThreadApplet2.java Listing 31.5 ThreadApplet2.JAVA: An Applet That ... have both theMyThread2.java and ThreadApplet3.java files in your CLASSESfolder Java will then compile both files when you compile ThreadApplet3.java Listing 31.6 MyThread2.java: A Double-Duty Thread. ... 23The Simplest Java ApplicationExample: Building an Application About Java Applications If you've run the HotJava browser, you've already had experience with Java applications The HotJavabrowser

Ngày tải lên: 22/07/2014, 16:21

56 374 0
giáo trình Java By Example phần 8 ppt

giáo trình Java By Example phần 8 ppt

... context = getAppletContext(); Tell Java that the applet uses the classes in the awt package Tell Java that the applet uses the classes in the applet package Tell Java that the applet uses the classes ... context.showDocument(url); } Trang 13Tell Java that the applet uses the classes in the awt package.Tell Java that the applet uses the classes in the applet package Tell Java that the applet uses the classes ... width, height, this); } } Tell Java that the applet uses the classes in the awt package Tell Java that the applet uses the classes in the applet package Tell Java that the applet uses the classes

Ngày tải lên: 22/07/2014, 16:21

46 400 0
giáo trình Java By Example phần 7 docx

giáo trình Java By Example phần 7 docx

... Applet17.java: Using Arrays. Trang 5 public void init() { textField = new TextField[3]; avg = new int[3]; Trang 6Tell Java that the program uses classes in the awt package.Tell Java that ... under Appletviewer.Listing 13.9 Applet18.java: Using a Two-Dimensional Array. Trang 14Tell Java that the program uses classes in the awt package.Tell Java that the program uses classes in the ... <= end) Trang 21Tell Java that the program uses classes in the awt package.Tell Java that the program uses classes in the applet package Derive the Applet8 class from Java's Applet class Declare

Ngày tải lên: 22/07/2014, 16:21

52 320 0
giáo trình Java By Example phần 4 pot

giáo trình Java By Example phần 4 pot

... Trang 1Tell Java that the applet uses the classes in the awt package.Tell Java that the applet uses the classes in the applet package Derive the ListApplet class from Java's Applet class ... 180); } } Tell Java that the applet uses the classes in the awt package Tell Java that the applet uses the classes in the applet package Derive the TextAreaApplet class from Java's Applet class ... Object arg) Tell Java that the applet uses the classes in the awt package. Tell Java that the applet uses the classes in the applet package. Derive the CheckboxApplet class from Java's Applet class.

Ngày tải lên: 22/07/2014, 16:21

35 336 0
giáo trình Java By Example phần 3 pot

giáo trình Java By Example phần 3 pot

... true; Trang 7Tell Java that the applet uses the classes in the awt package.Tell Java that the applet uses the classes in the applet package Derive the MenuBarApplet class from Java's Applet class ... Button("Button4"); Tell Java that the applet uses the classes in the awt package Tell Java that the applet uses the classes in the applet package Trang 13Derive the PanelApplet class from Java's Applet ... Button("Button3");Tell Java that the applet uses the classes in the awt package Tell Java that the applet uses the classes in the applet package Derive the CardApplet class from Java's Applet class

Ngày tải lên: 22/07/2014, 16:21

57 367 0
giáo trình Java By Example phần 2 pdf

giáo trình Java By Example phần 2 pdf

... MouseApplet applet responds to mouse clicks. Listing 25.1 MouseApplet.java: Using Mouse Clicks in an Applet. import java.awt.*; import java.applet.*; public class MouseApplet extends Applet { int coordX, ... -1; Trang 5Tell Java that the applet uses the classes in the awt package.Tell Java that the applet uses the classes in the applet package Trang 6Derive the MouseApplet class from Java's Applet ... ++x) Trang 9Tell Java that the applet uses the classes in the awt package.Tell Java that the applet uses the classes in the applet package Derive the MouseApplet2 class from Java's Applet class

Ngày tải lên: 22/07/2014, 16:21

42 423 0
giáo trình Java By Example phần 1 ppsx

giáo trình Java By Example phần 1 ppsx

... Trang 1Chapter 1 Java OverviewThe Java Story Trang 2Chapter 2 Running Java AppletsThe Sample Java Applets The Appletviewer Tool Adding Applets to an HTML ... that Java was developed for a very different use In fact, "Java" isn'teven the language's original name In this chapter, you'll get a quick look at Java's history, as well aslearn why Java ... five years of development, Java has found its home Figure 1.2 : The new Netscape Navigator 2.0 Web browser is Java capable. Introducing Java By now, you may be curious why Java is considered such

Ngày tải lên: 22/07/2014, 16:21

66 344 0
Giáo trình Java - Chương 3 docx

Giáo trình Java - Chương 3 docx

... dụng ngôn ngữ Java và các tập API của Java Trang 8Giáo trình Java Ths Nguyễn Trọng Dũng Trường ĐHSP Hà Nội • Từ phiên bản WSDP 2.0 JAX-RPC được đặt tên lại thành JAX-WS 3 JAXB (Java API for XML ... file source java Trang 11Giáo trình Java Ths Nguyễn Trọng Dũng Trường ĐHSP Hà Nội encoding: Xác định encoding được sử dụng cho các file source java target: Tạo ra các file class ứng với một phiên ... dịch các file java ở chế độ tương thích với phiên bản java 1.5 1.1 Viết các file Java • Viết các java bean được dùng để lưu trữ dữ liệu được truyền giữa client và server Document.java package

Ngày tải lên: 08/08/2014, 16:22

28 161 0
giáo trình java tóm tắt - collections

giáo trình java tóm tắt - collections

... Trang 1Java Collections Framework Java Collections Framework 1 1 Giới thiệu chung 1 2 List 2 3 Các interface Iterable, ... gian và công sức Để khắc phục nhược điểm trên của array, Java đã xây dựng một dạng dữ liệu gọi chung là collection, được đặt trong package java.util Các đối tượng collection có khả năng lưu trữ ... Dưới đây là sơ đồ quan hệ của Java Collections Framework (chỉ có một số interface và class chính) Trang 2Hình 1: Collections Framework2 List List là một bộ phận của Java Collections, list được

Ngày tải lên: 24/10/2014, 00:34

14 977 0
giáo trình java tóm tắt - jdbc

giáo trình java tóm tắt - jdbc

... 6 ResultSet 8 7 Java và Oracle – OJDBC 9 1 Giới thiệu JDBC JDBC là chữ viết tắt của "Java DataBase Connectivity", là một chuẩn truy xuất cơ sở dữ liệu trên môi trường Java do Sun MicroSystem ... sở dữ liệu và xử lý tất cả các thao tác giao tiếp với cơ sở dữ liệu đó 2.3 Package java.sql Dưới đây là các class và interface chính của package java.sql a Class DriverManager Có chức năng nạp ... ResultSet), cung cấp khả năng hỗ trợ JavaBeans Một RowSet có thể được dùng như một thành phần JavaBeans trong môi trường Bean, có thể được tạo ra lúc lập trình và sử dụng lúc chạy ứng dụng 3

Ngày tải lên: 24/10/2014, 00:35

14 686 0
giáo trình java tóm tắt - streams

giáo trình java tóm tắt - streams

... nhiều chương trình, ta cần lưu trữ dữ liệu lên bộ nhớ phụ và đọc lên để sử dụng khi cần, hoặc truyền dữ liệu từ nơi này sang nơi khác Để đáp ứng nhu cầu này, Java cung cấp package java.io với rất ... trong Java Ngoài ra còn có các filter stream với chức năng sử lý bổ sung (định dạng, tạo vùng đệm, ) khi đọc/ghi dữ liệu Có rất nhiều (khoảng 60) lớp stream, nhưng trong phạm vi chương trình, ... stream cụ thể 2.3 Các ví dụ Để dùng các stream, trước hết cần import package java.io import java.io.*; Dưới đây sẽ trình bày các ví dụ về file stream và piped stream File stream: String fileName=

Ngày tải lên: 24/10/2014, 00:35

20 503 0
giáo trình java tóm tắt - strings

giáo trình java tóm tắt - strings

... dùng StringBuilder, nếu dùng trong môi trường đa tiểu trình thì dùng StringBuffer 2 Lớp String 2.1 Giới thiệu Trong Java lớp String (package java.lang) được dùng để biểu diễn các chuỗi ký tự Tất ... sau:String s= "Java" ; s+= "String" ; // s sẽ là "JavaString" phép nối chuỗi này thoạt nhìn thì giống như là thêm đọan "String" vào chuỗi "Java", nhưng thực ... như vậy Trong Java, String là đối tượng không thể thay đổi nên không thể nối thêm một phần vào chuỗi "Java" được Bản chất của lệnh đó là tạo ra một chuỗi mới có giá trị "JavaString",

Ngày tải lên: 24/10/2014, 00:35

11 538 0
GIÁO TRÌNH JAVA cơ bản

GIÁO TRÌNH JAVA cơ bản

... đó có chứa “máy ảo Java” Máy ảo Java l à một tập các quy ước về chỉ thị, dạng thức l ưu trữ,thanh ghi v.v như máy tính th ực sự và trình thông dịch Java tạo ra máy ảo Java này Trình thông dịch ... thực chất là chạy các Applet Java trên Web Tập mã nhị phân Java Máy ảo Java Trang 2 Hãng Microsoft thấy được tính ưu việt của Java nên đã bắt tay xây dựng môitrình lập trình cho ngôn ngữ này Sau ... “nói chuyện” được với nhau ư? Java xoá bỏ ranh giới đó bằng công nghệ m à Sun Microsystem gọi là “máy ảo Java” Nghĩa là chương trình được biên dịch thành “mã máy” của máy ảo Java,sau đó bất cứ

Ngày tải lên: 03/02/2015, 09:21

78 351 0
Giáo trình Java cơ bản 01

Giáo trình Java cơ bản 01

... programming using the Java language  To gain experience in engineering reliable programs Trang 5… in particular  OOJ/OJA and IPJ/IJA have been designed to form the core of Java programming  They ... Trang 1Welcome to Object-Oriented Programming Using Java Trang 3► Subject Information Trang 41/4 Subject aims  To understand how computers work  ... IPJ/IJA have been designed to form the core of Java programming  They provide a solid foundation for Java application development Trang 61/6 Teaching philosophy  Learning is an active process  The

Ngày tải lên: 24/03/2016, 22:01

33 324 0
Giáo trình Java cơ bản 02

Giáo trình Java cơ bản 02

... Trang 35Running Java programs  Java compilation process  Java execution process – Java byte code is read and executed via a Java byte code interpreter Program written in Java Java byte code ... run Java programs in Unix  To create a file > vi <filename> Note: to create a Java program the filename must end in java  To compile a program > javac <filename>.java ... Intermediate code compiler javac Trang 36Byte code and JVM  The javac command converts the source programs into byte code  Byte code files are those with the extension .class  The java command causes

Ngày tải lên: 24/03/2016, 22:03

38 324 0
Giáo trình Java cơ bản 04

Giáo trình Java cơ bản 04

... Trang 14Execution staring point in JavaJava programs are a collection of classes  Each class must be stored in a file with the same name, but also with the java extension  A class may have ... main method specified to the interpreter: > java MyClass starts at the main method in the class MyClass Trang 15Execution staring point in Java us a place to start in the program driver ... algorithms to solve problems – How to convert algorithms into programs – How to edit, compile and run Java programs Trang 2► Elements of a program Trang 4Input and output – A way of receiving information

Ngày tải lên: 24/03/2016, 22:05

33 283 0
Giáo trình Java cơ bản 07

Giáo trình Java cơ bản 07

... an initial capital shoeSize – This convention is sometimes referred to as camelBack notation  Java is case sensitive, therefore it distinguishes between uppercase and Trang 8Keywords  Keywords ... floating-point Trang 12Integer data types positive and negative values)  4 types of integers in Java that store values in different amounts of memory range of values they can store specific ... Floating-point number types store numbers with fractional parts  2 types of floating-point numbers in Java that store values in different amounts of memory  Not all numbers can be stored exactly using

Ngày tải lên: 24/03/2016, 22:07

39 302 0
w