100% found this document useful (1 vote)
143 views53 pages

جافا1

Uploaded by

Samir Said
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
143 views53 pages

جافا1

Uploaded by

Samir Said
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

MYS-ME

2010

MYS-ME

* ) "*( JAVA "1

// .
-:

[email protected]








....

MYS-ME

)(1
.
sun java
windows JDK

framework.net ). (C# , vb.net , j#
.
). (Net beans

:
:Project .
. Form mobile web :
: Package )(class
). (Forms
: Class
.
:Form .interface
:
.1 :

.2 :

MYS-ME

.3 File . New project

.4 :

.5

:
: Set as main project . : Create Main Class Load vb.net
system32
.
.6 . Finish

MYS-ME

.7 :

Libraries . JDK Source Packages .----------------------------------------------------------- :

MYS-ME

:
.1 F5
.

.2 :

MYS-ME

.
.3 :

.4 ) ( :

.5 :

.6 ) ( :
.
: extends
javax.swing.Jframe . Form1
: javax.swing.JFrame .
: initComponents

.

MYS-ME

: .
:
: jTextField1 + jTextField2
Center = horizontal alignment -:


jTextField : .
:

) (" " + Res Res


double
.

double ) (d
Double
: double ) (Data type . : Double - ) ( Data class . parseDouble

; double No1,No2,Res
:
double
-----------------------;))(No1 = Double.parseDouble(jTextField1.getText
;))(No2 = Double.parseDouble(jTextField2.getText
jTextField1
getText
Double.parseDouble No1,No2
-------------------------; Res = No1 + No2
Res
-------------------------;)JLabel1.setText("" + Res
Res JLabel1

MYS-ME


.1

: Form1

.2
) ( :

:



) ( :


.
) (
ctrl + space
. enter
:
)(Data class
Double

double

Flout

flout

Integer

)(Data type

int

MYS-ME

byte
short
int
long
float
double
char
String
boolean

8 bit
16 bit
32 bit
64 bit
32 bit
64 bit
16 bit
1 bit

X=A+B
X=A-B
X=A*B
X=A/B

) ( A+=B ) = ( A = A + B
) ( A-=B ) = ( A = A - B
) ( A*=B ) = ( A = A * B
) ( A/=B ) = ( A = A / B
) ( A%=B ) = ( A = A % B
) ( A++) = ( A = A + 1
) ( A--) = ( A = A - 1
X = A%B

+
*
/
=+
=-
=*
=/
=%
++
-%

>
<

And
Or
Xor



=
=!
>
<
=>
=<
&
&&
|| |
^

x==y
x!=y
x>y
x<y
x>=y
x<=y
) if ( x ==1 & y== 1
) if ( x = =1 | y== 1
) if ( x == 1 ^ y== 1

x y
x y
x y
x y
x y
x y


-

MYS-ME

10

:
: IF

:
.
:

MYS-ME

11

)(2

: IF .

MYS-ME

12

: Switch
:
:
) 1 ( one . ...



..

MYS-ME

13

) ( :
:
JComboBox

:

.1 ) : ( FOR
:

: JComboBox
) ( model
.

MYS-ME

14

:
.

.2 ) : ( while
:

:
20 10
JComboBox

MYS-ME

15

.3 ) : ( Do while
:
:

) (


.

: 20 1 . JComboBox

:
) ( // :

) * ( / ) ( */ :

MYS-ME

16


:
-

File
save save all
.
: - -




C:\Users\MYS-ME :
. MYS-ME

File

Open Project
. Open project Folder

:

.
Ctrl + Alt + F

MYS-ME

17


: : Message Dialog

:

.

:
. jTextField

MYS-ME

18

: : Confirm Dialog

) ( :


... .
: jTextField
.

:
Yes = 0 ok
No = 1
cancel = 2

;) sign = JOptionPane.showConfirmDialog(null,"Do you want to delete ?","Delete", 0 , 3


)if (sign == 0


)( ) ( Yes , No :

MYS-ME

19

: .

MYS-ME

20

) : (2
yes No
.

form Window Closing




.Form

: : input Dialog
:

; )(JOptionPane.showInputDialog

MYS-ME

21

) : (1 . Jlabel
:

:
;]Type variable [] = New Type [size

: .
; ]Int x[] = New Int[3



:

MYS-ME

22

-:
.1 :
:
;} Type variable[] = { , , , ,

: )
... ( jComboBox
.

.2 :
;]Type variable[] = New Type [size
; Variable [index] = value

:
; x[0] = 1
; x[1] = 5

MYS-ME

23

) : (1 . List
:

: )( list

:

AWT
) (+

:

: AWT Swing
AWT Swing
.

MYS-ME

24

: :
list AWT

Ctrl + Space .


NetBeans
:

) : (2 )( list
) (list
:

MYS-ME

25

MYS-ME

26


:
.
)( -:
.1 :


jTextField

:

MYS-ME

27

:
.1 package public class
:

.2 :

) (

MYS-ME

28

:
.2 :

.1 :

.3 :

MYS-ME

29

.1 :
.
:
.4
:

.1
) ( .

.2
. Event

.3

.

:

.2 :

: Remove

MYS-ME

30

.3 :
.
: Enter
.
:
) : ( Key pressed
:

: if
.

: )( :

Enter
:

MYS-ME

31

.1
.2
.3
.4

:
) ( .
.
.
.

: ) : ( Procedure .
) : (1
) (

:

MYS-ME

32

:
:

) : (2 -:
:



shift


. Shift
: jTextField Text
.
jTextField
Focusable :

.1 :
:

MYS-ME

33

.
.
.
. ...

: ) : (Function .
) : (1 :

MYS-ME

34

) : (2
) ( Name found ) (Name not found
.
.1 :

.2

True False

.

: Equals
Text
text .
.3
:

MYS-ME

35

:


) - ( return -

.

) : (3 ) ( Prosegur .
:
:

: .



. OK

MYS-ME

36


:

) (Driver ) (ODBC
:
JDBC ): (Java Database Connectivity
JDK ) (SQL
MySQL Access Oracle
.
ODBC ): (Open Database Connectivity

. windows
: (JDBC- ODBC bridge)

JDBC
) (JDBC-ODBC bridge

) ODBC ( .

MYS-ME

37

Driver ) (PDBC
:
.1 :
. . SQL
: SQL

: . public class
. .

.2 :
. ). (Connection
. ). (Statement

. ). (Result Set

:
:

MYS-ME

38

: : 2003
.1 :

.2 ): (Blank database

.3 :

MYS-ME

39

.4 :

.5 ) (

:

)(1
)(2
.6

). (Stu_table
.7 :

.8
:

.9

.

MYS-ME

40

:
:
.1
.

.3
: Administrative Tools

.2
: performance and Maintenance
.4
): Data Sources (ODBC

.5 add
:

MYS-ME

41

.6
:

.7 :

.8
:

MYS-ME

42


:
: SQL :



) ( .



:

) : ( 11 10 2 1 ) ( .
) : ( 3 ) ( JDBC Driver :
: Class .
: forName Class .
) : ( 4
Stu_Link con
jdbc:odbc
. jdbc:odbc:stu_link

MYS-ME

43

) : ( 5
- ) . - ( 45
) : ( 6 ResultSet
) ( 7 ) - ( rs
. -
) : ( 7 SQL
) . ( rs
) : ( 8 ) (
.
) : ( 9
) ( Mohammed ) . ( 8
:
) ( 8 ) ( Ahmed
) ( Mohammed :
) : ( 13 .
) : ( 14 .

:


jTextField
jTextField :
1 ) ( 9 :

MYS-ME

44

2 :


: jTextField
:


) ( rs
) ( 6
:

MYS-ME

45

ResultSet )
(

) ( 5 :

.
:

previous first :

previous last :

MYS-ME

46

: jTable1


.


Try :

MYS-ME

47

while try
:

MYS-ME

48

:
:

:
.

: .

) (con
:

MYS-ME

49

: PreparedStatement Statement

Statement
) (
SQL .

MYS-ME

50

:
:

SQL :

: :


) ( +
Enter
.

MYS-ME

51

MYS-ME

52

The End of the Book


- -

MYS-ME

MYS-ME

53

You might also like