SlideShare ist ein Scribd-Unternehmen logo
1 von 41
After studying this lesson the students will be able to:
1. Identify, name and state the usage of the different components of the NetBeans
IDE.
2. Identify and name the various methods and properties associated with the various
form controls
3. Create simple applications in Java using NetBeans IDE.
4. Create GUI applications using the concepts of variables and control structures.
NetBeans is an integrated development environment (IDE) for developing
primarily with Java, but also with other languages, in particular PHP, C/C++,
and HTML5. It is also an application platform framework for Java desktop
applications and others. The NetBeans IDE is written in Java and can run on
Windows, OS X, Linux, Solaris and other platforms supporting a
compatible JVM. The NetBeans Platform allows applications to be developed
from a set of modular software components called modules. Applications
based on the NetBeans Platform (including the NetBeans IDE itself) can be
extended by third party developers.
The various componets of Netbeans IDE are:
1. Title Bar
2. Menu Bar
3. Toolbars
4. GUI builder
5. Palette
6. Inspector Window
7. Properties Window
8. Code Editor Window
Components (also known as "widgets") are the basic
interface elements the user interacts with: jlabels,
jbuttons, jtextfields etc. Components are placed on a
container like the jFrame).
There are two types of controls :
1. Parent Controls:
They act as a background for other controls. For
example-Frame. When we delete a parent control,
all its child controls get deleted. When we move a
parent control all its child controls also move along
with it.
2. Child Control:
controls placed inside a container control are called
child controls. For example-Text Field, Label, Button
etc.
Properties of an object are used to specify its appearance on the form. For example to set the
background colour of a textfield you change its background property; to set its font you change
its font property; and so on.
Methods are used to perform some action on the object. For example to display something in a
textfield you can use its setText() method, to extract the contents of a textfield you can use its
getText() method. Methods can be divided into two categories getters and setters.
Events are the actions which are performed on controls. Examples of events are: mouseClick,
mouseMoved,keyPressed etc. When the user performs any action on a control, an event
happens and that event invokes (sends a call to) the corresponding part of the code and the
application behaves accordingly.
We will be looking at the methods and properties of various componets. They
are :
1.jFrameForm
2.jButton
3.jTextField
4.jLabel
5.jTextArea
6.jPassword
7.jRadioButton
8.jCheckBox
9.jComboBox
10.jList
jFrame in Navigator Window
jButton
jTextField
jLabel
jTextArea
jPassword
jRadioButton
Group
jCheckBox
jComboBox
jList
In computer programming, a variable or scalar is a storage location and an
associated symbolic name (an identifier) which contains some known or unknown
quantity or information, a value. The variable name is the usual way to reference the
stored value; this separation of name and content allows the name to be used
independently of the exact information it represents.
The characteristics of a variable are:
1. It has a name.
2. It is capable of storing values.
3. It provides temporary storage.
When programming, we store the variables in our computer's memory, but the computer has to
know what kind of data we want to store in them, since it is not going to occupy the same
amount of memory to store a simple number or to store a single letter or a large number, and
they are not going to be interpreted the same way so variables were used along with data types.
The data types supported by java are summarized as follows:
Data type states the way the values of that type are stored, the operations that can be
done on that type, and the range for that type.
These data types are used to store integer values only i.e. whole
numbers only. The storage size and range is listed below :
These data types are used to store numbers having decimal points i.e.
they can store numbers having fractional values.
With the introduction of variables and constants there arose a need to
perform certain operations on them. We performed operations on
variables and constants using operators. The operators available in java
are summarized below:
Assignment Operator :
One of the most common operator is the assignment operator "=" which
is used to assign a value to a variable. We assign the value given on the
right hand side to the variable specified on the left hand side. The value
on the right hand side can be a number or an arithmetic expression.
For example:
Arithmetic Operators :
These operators perform addition, subtraction, multiplication, and division. These
symbols are similar to mathematical symbols. The only symbol that is different is "%“,
which divides one operand by another and returns the remainder as its result.
Relational Operator :
A relational operator is used to test for some kind of relation between two entities. A
mathematical expression created using a relational operator forms a relational
expression or a condition. The following table lists the various relational operators and
their usage:
Logical Operator :
A logical operator denotes a logical operation. Logical operators and relational operators are
used together to form a complex condition. Logical operators are:
Unary Operators :
The unary operators perform different kind of operations on a single operand .The operations
performed are increasing/decreasing a value, negating a value/ expression, or inverting a
Boolean value.
Control structures allow us to control the flow of our program's execution. If left
unchecked by control-flow statements, a program's logic will flow through statements
from top to bottom. We can have some control on the flow of a program by using
operators to regulate precedence of operations, but control structures provide the
power to change statement order and govern the flow of control in a program.
Simple if Statement - The if statement allows selection (decision making)
depending upon the outcome of a condition. If the condition evaluates to true then the
statement immediately following if will be executed and otherwise if the condition
evaluates to false then the statements following the else clause will be executed. The
selection statements are also called conditional statements or decision statements.
 Nested if . . . else - These control structures are used to test for multiple
conditions as against the simple if statement which can be used to test a single
condition. The syntax of nested if else is as follows:
 Switch Statement - This selection statement allows us to test the value of an
expression with a series of character or integer values. On finding a matching value the
control jumps to the statement pertaining to that value and the statement is executed, till
the break statement is encountered or the end of switch is reached. The expression must
either evaluate to an integer value or a character value. It cannot be a string or a real
number. The syntax of the switch statement is as follows:
These statements are used to perform a set of instructions repeatedly while the condition is true.
Iteration statements are also called looping statements.
for loop - The loop has four different elements that have different purposes. These elements are:
a) Initialization expression: Before entering in a loop, its variables must be initialized.
b) Test Expression: The test expression decides whether the loop body will be executed or not. If
the test condition is true, the loop body gets executed otherwise the loop is terminated.
c) Increment/Decrement Expression: The Increment/Decrement expression changes the value of
the loop variable.
d) The Body of the loop: The statements, which are executed repeatedly while the test
expression evaluates to true form the body of the loop.
The syntax of the for loop is:
 While Loop –
The while loop is an entry-controlled loop. It means that the loop
condition is tested before executing the loop body. If the loop condition
is initially false, for the first iteration, then loop may not execute even
once. The main characteristic of the while loop is that it can be used in
both cases i.e. when the number of iterations is known as well as when it
is unknown. The syntax of the while loop is as follows:
 Do..While Loop -
Do..While loop is an exit-controlled loop. In the do..while loop, the test occurs at the
end of the loop. This ensures that the do..while loop executes the statements included
in the loop body at least once. After the first execution of the statement, it evaluates the
test expression. If the expression evaluates to true, then it executes the statements of
the loop body again. Like if and while statements, the condition being checked must be
included between parenthesis. The while statement must end with a semicolon. The
syntax of the loop is as follows:
 NetBeans is an IDE using which we can develop GUI applications in Java.
 NetBeans provides various components used to create a GUI front-end
 interface.
 GUI components' appearance and behavior is controlled by their properties
and methods.
 We should use meaningful names for controls on the form and variables in
the
 code. It makes programming convenient.
 Some useful Data Types supported in Java are: int, double, char and boolean.
 String is an Object (reference) type supported in Java.
 A variable must be declared before it can be used.
 Different types of operators are available in Java. Operators are used to
perform various operations on data.
 Control Statements available in java are: if..else, switch..case, for, while,
do..while.
GUI Programming in JAVA (Using Netbeans) -  A Review

Weitere ähnliche Inhalte

Was ist angesagt?

introduction to visual basic PPT.pptx
introduction to visual basic PPT.pptxintroduction to visual basic PPT.pptx
introduction to visual basic PPT.pptxclassall
 
Event handling
Event handlingEvent handling
Event handlingswapnac12
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3Mohd Tousif
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligencesandeep54552
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplicationMegha V
 
Quick sort Algorithm Discussion And Analysis
Quick sort Algorithm Discussion And AnalysisQuick sort Algorithm Discussion And Analysis
Quick sort Algorithm Discussion And AnalysisSNJ Chaudhary
 
Visual Programming
Visual ProgrammingVisual Programming
Visual ProgrammingBagzzz
 
Regular language and Regular expression
Regular language and Regular expressionRegular language and Regular expression
Regular language and Regular expressionAnimesh Chaturvedi
 

Was ist angesagt? (20)

introduction to visual basic PPT.pptx
introduction to visual basic PPT.pptxintroduction to visual basic PPT.pptx
introduction to visual basic PPT.pptx
 
Algorithm Introduction
Algorithm IntroductionAlgorithm Introduction
Algorithm Introduction
 
Event handling
Event handlingEvent handling
Event handling
 
CS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna UniversityCS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna University
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3
 
JavaFX Presentation
JavaFX PresentationJavaFX Presentation
JavaFX Presentation
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplication
 
chapter 1
chapter 1chapter 1
chapter 1
 
Quick sort Algorithm Discussion And Analysis
Quick sort Algorithm Discussion And AnalysisQuick sort Algorithm Discussion And Analysis
Quick sort Algorithm Discussion And Analysis
 
Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
 
Java swing
Java swingJava swing
Java swing
 
Data Structure and Algorithm - Divide and Conquer
Data Structure and Algorithm - Divide and ConquerData Structure and Algorithm - Divide and Conquer
Data Structure and Algorithm - Divide and Conquer
 
Chapter 5 Syntax Directed Translation
Chapter 5   Syntax Directed TranslationChapter 5   Syntax Directed Translation
Chapter 5 Syntax Directed Translation
 
Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
GUI components in Java
GUI components in JavaGUI components in Java
GUI components in Java
 
SQLite database in android
SQLite database in androidSQLite database in android
SQLite database in android
 
Visual Programming
Visual ProgrammingVisual Programming
Visual Programming
 
Regular language and Regular expression
Regular language and Regular expressionRegular language and Regular expression
Regular language and Regular expression
 

Andere mochten auch

GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Javayht4ever
 
JAVA GUI PART I
JAVA GUI PART IJAVA GUI PART I
JAVA GUI PART IOXUS 20
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)Bilal Amjad
 
Java Swing
Java SwingJava Swing
Java SwingShraddha
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1PRN USM
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Javababak danyal
 
Java GUI PART II
Java GUI PART IIJava GUI PART II
Java GUI PART IIOXUS 20
 
JAVA GUI PART III
JAVA GUI PART IIIJAVA GUI PART III
JAVA GUI PART IIIOXUS 20
 
Introduction to java netbeans
Introduction to java netbeansIntroduction to java netbeans
Introduction to java netbeansShrey Goswami
 
Basic of Java Netbeans
Basic of Java NetbeansBasic of Java Netbeans
Basic of Java NetbeansShrey Goswami
 
USER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPTUSER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPTvicci4041
 
Mental models
Mental modelsMental models
Mental modelsaukee
 
Web Application and HTML Summary
Web Application and HTML SummaryWeb Application and HTML Summary
Web Application and HTML SummaryFernando Torres
 
Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1Kiki Ahmadi
 
Developing Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and PayaraDeveloping Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and PayaraPayara
 

Andere mochten auch (20)

GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
 
JAVA GUI PART I
JAVA GUI PART IJAVA GUI PART I
JAVA GUI PART I
 
Graphical User Interface (Gui)
Graphical User Interface (Gui)Graphical User Interface (Gui)
Graphical User Interface (Gui)
 
Java Swing
Java SwingJava Swing
Java Swing
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
 
Java swings
Java swingsJava swings
Java swings
 
Swing and Graphical User Interface in Java
Swing and Graphical User Interface in JavaSwing and Graphical User Interface in Java
Swing and Graphical User Interface in Java
 
Gui
GuiGui
Gui
 
Java GUI PART II
Java GUI PART IIJava GUI PART II
Java GUI PART II
 
JAVA GUI PART III
JAVA GUI PART IIIJAVA GUI PART III
JAVA GUI PART III
 
Introduction to java netbeans
Introduction to java netbeansIntroduction to java netbeans
Introduction to java netbeans
 
Basic of Java Netbeans
Basic of Java NetbeansBasic of Java Netbeans
Basic of Java Netbeans
 
Java swing
Java swingJava swing
Java swing
 
java swing tutorial for beginners(java programming tutorials)
java swing tutorial for beginners(java programming tutorials)java swing tutorial for beginners(java programming tutorials)
java swing tutorial for beginners(java programming tutorials)
 
USER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPTUSER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPT
 
Mental models
Mental modelsMental models
Mental models
 
Web Application and HTML Summary
Web Application and HTML SummaryWeb Application and HTML Summary
Web Application and HTML Summary
 
Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1Simple Unit Testing With Netbeans 6.1
Simple Unit Testing With Netbeans 6.1
 
Windows 3.0 And 3.1
Windows 3.0 And 3.1Windows 3.0 And 3.1
Windows 3.0 And 3.1
 
Developing Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and PayaraDeveloping Java EE applications with NetBeans and Payara
Developing Java EE applications with NetBeans and Payara
 

Ähnlich wie GUI Programming in JAVA (Using Netbeans) - A Review

Password protected diary
Password protected diaryPassword protected diary
Password protected diarySHARDA SHARAN
 
Android Application Development - Level 3
Android Application Development - Level 3Android Application Development - Level 3
Android Application Development - Level 3Isham Rashik
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoftch samaram
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes NUST Stuff
 
PYTHON NOTES
PYTHON NOTESPYTHON NOTES
PYTHON NOTESNi
 
Functional programming in TypeScript
Functional programming in TypeScriptFunctional programming in TypeScript
Functional programming in TypeScriptbinDebug WorkSpace
 
C# language basics (Visual Studio)
C# language basics (Visual Studio) C# language basics (Visual Studio)
C# language basics (Visual Studio) rnkhan
 
C# language basics (Visual studio)
C# language basics (Visual studio)C# language basics (Visual studio)
C# language basics (Visual studio)rnkhan
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYRajeshkumar Reddy
 
1669958779195.pdf
1669958779195.pdf1669958779195.pdf
1669958779195.pdfvenud11
 
Book management system
Book management systemBook management system
Book management systemSHARDA SHARAN
 
JAVA(module1).pptx
JAVA(module1).pptxJAVA(module1).pptx
JAVA(module1).pptxSRKCREATIONS
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving TechniquesAshesh R
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxssusere336f4
 

Ähnlich wie GUI Programming in JAVA (Using Netbeans) - A Review (20)

Password protected diary
Password protected diaryPassword protected diary
Password protected diary
 
Android Application Development - Level 3
Android Application Development - Level 3Android Application Development - Level 3
Android Application Development - Level 3
 
MODULE_2_Operators.pptx
MODULE_2_Operators.pptxMODULE_2_Operators.pptx
MODULE_2_Operators.pptx
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
 
Handout # 4 functions + scopes
Handout # 4   functions + scopes Handout # 4   functions + scopes
Handout # 4 functions + scopes
 
PYTHON NOTES
PYTHON NOTESPYTHON NOTES
PYTHON NOTES
 
Java script basic
Java script basicJava script basic
Java script basic
 
Functional programming in TypeScript
Functional programming in TypeScriptFunctional programming in TypeScript
Functional programming in TypeScript
 
C# language basics (Visual Studio)
C# language basics (Visual Studio) C# language basics (Visual Studio)
C# language basics (Visual Studio)
 
C# language basics (Visual studio)
C# language basics (Visual studio)C# language basics (Visual studio)
C# language basics (Visual studio)
 
Pc module1
Pc module1Pc module1
Pc module1
 
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDYC UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
C UNIT-2 PREPARED Y M V BRAHMANANDA REDDY
 
Review Python
Review PythonReview Python
Review Python
 
1669958779195.pdf
1669958779195.pdf1669958779195.pdf
1669958779195.pdf
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Book management system
Book management systemBook management system
Book management system
 
Programming in c by pkv
Programming in c by pkvProgramming in c by pkv
Programming in c by pkv
 
JAVA(module1).pptx
JAVA(module1).pptxJAVA(module1).pptx
JAVA(module1).pptx
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
classVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptxclassVI_Coding_Teacher_Presentation.pptx
classVI_Coding_Teacher_Presentation.pptx
 

Kürzlich hochgeladen

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Kürzlich hochgeladen (20)

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

GUI Programming in JAVA (Using Netbeans) - A Review

  • 1.
  • 2. After studying this lesson the students will be able to: 1. Identify, name and state the usage of the different components of the NetBeans IDE. 2. Identify and name the various methods and properties associated with the various form controls 3. Create simple applications in Java using NetBeans IDE. 4. Create GUI applications using the concepts of variables and control structures.
  • 3. NetBeans is an integrated development environment (IDE) for developing primarily with Java, but also with other languages, in particular PHP, C/C++, and HTML5. It is also an application platform framework for Java desktop applications and others. The NetBeans IDE is written in Java and can run on Windows, OS X, Linux, Solaris and other platforms supporting a compatible JVM. The NetBeans Platform allows applications to be developed from a set of modular software components called modules. Applications based on the NetBeans Platform (including the NetBeans IDE itself) can be extended by third party developers.
  • 4.
  • 5. The various componets of Netbeans IDE are: 1. Title Bar 2. Menu Bar 3. Toolbars 4. GUI builder 5. Palette 6. Inspector Window 7. Properties Window 8. Code Editor Window
  • 6. Components (also known as "widgets") are the basic interface elements the user interacts with: jlabels, jbuttons, jtextfields etc. Components are placed on a container like the jFrame). There are two types of controls : 1. Parent Controls: They act as a background for other controls. For example-Frame. When we delete a parent control, all its child controls get deleted. When we move a parent control all its child controls also move along with it. 2. Child Control: controls placed inside a container control are called child controls. For example-Text Field, Label, Button etc.
  • 7. Properties of an object are used to specify its appearance on the form. For example to set the background colour of a textfield you change its background property; to set its font you change its font property; and so on. Methods are used to perform some action on the object. For example to display something in a textfield you can use its setText() method, to extract the contents of a textfield you can use its getText() method. Methods can be divided into two categories getters and setters. Events are the actions which are performed on controls. Examples of events are: mouseClick, mouseMoved,keyPressed etc. When the user performs any action on a control, an event happens and that event invokes (sends a call to) the corresponding part of the code and the application behaves accordingly.
  • 8. We will be looking at the methods and properties of various componets. They are : 1.jFrameForm 2.jButton 3.jTextField 4.jLabel 5.jTextArea 6.jPassword 7.jRadioButton 8.jCheckBox 9.jComboBox 10.jList
  • 12.
  • 13.
  • 15.
  • 18.
  • 20.
  • 22.
  • 24.
  • 25. jList
  • 26. In computer programming, a variable or scalar is a storage location and an associated symbolic name (an identifier) which contains some known or unknown quantity or information, a value. The variable name is the usual way to reference the stored value; this separation of name and content allows the name to be used independently of the exact information it represents. The characteristics of a variable are: 1. It has a name. 2. It is capable of storing values. 3. It provides temporary storage.
  • 27. When programming, we store the variables in our computer's memory, but the computer has to know what kind of data we want to store in them, since it is not going to occupy the same amount of memory to store a simple number or to store a single letter or a large number, and they are not going to be interpreted the same way so variables were used along with data types. The data types supported by java are summarized as follows: Data type states the way the values of that type are stored, the operations that can be done on that type, and the range for that type.
  • 28. These data types are used to store integer values only i.e. whole numbers only. The storage size and range is listed below :
  • 29. These data types are used to store numbers having decimal points i.e. they can store numbers having fractional values.
  • 30. With the introduction of variables and constants there arose a need to perform certain operations on them. We performed operations on variables and constants using operators. The operators available in java are summarized below: Assignment Operator : One of the most common operator is the assignment operator "=" which is used to assign a value to a variable. We assign the value given on the right hand side to the variable specified on the left hand side. The value on the right hand side can be a number or an arithmetic expression. For example:
  • 31. Arithmetic Operators : These operators perform addition, subtraction, multiplication, and division. These symbols are similar to mathematical symbols. The only symbol that is different is "%“, which divides one operand by another and returns the remainder as its result. Relational Operator : A relational operator is used to test for some kind of relation between two entities. A mathematical expression created using a relational operator forms a relational expression or a condition. The following table lists the various relational operators and their usage:
  • 32. Logical Operator : A logical operator denotes a logical operation. Logical operators and relational operators are used together to form a complex condition. Logical operators are: Unary Operators : The unary operators perform different kind of operations on a single operand .The operations performed are increasing/decreasing a value, negating a value/ expression, or inverting a Boolean value.
  • 33. Control structures allow us to control the flow of our program's execution. If left unchecked by control-flow statements, a program's logic will flow through statements from top to bottom. We can have some control on the flow of a program by using operators to regulate precedence of operations, but control structures provide the power to change statement order and govern the flow of control in a program.
  • 34. Simple if Statement - The if statement allows selection (decision making) depending upon the outcome of a condition. If the condition evaluates to true then the statement immediately following if will be executed and otherwise if the condition evaluates to false then the statements following the else clause will be executed. The selection statements are also called conditional statements or decision statements.
  • 35.  Nested if . . . else - These control structures are used to test for multiple conditions as against the simple if statement which can be used to test a single condition. The syntax of nested if else is as follows:
  • 36.  Switch Statement - This selection statement allows us to test the value of an expression with a series of character or integer values. On finding a matching value the control jumps to the statement pertaining to that value and the statement is executed, till the break statement is encountered or the end of switch is reached. The expression must either evaluate to an integer value or a character value. It cannot be a string or a real number. The syntax of the switch statement is as follows:
  • 37. These statements are used to perform a set of instructions repeatedly while the condition is true. Iteration statements are also called looping statements. for loop - The loop has four different elements that have different purposes. These elements are: a) Initialization expression: Before entering in a loop, its variables must be initialized. b) Test Expression: The test expression decides whether the loop body will be executed or not. If the test condition is true, the loop body gets executed otherwise the loop is terminated. c) Increment/Decrement Expression: The Increment/Decrement expression changes the value of the loop variable. d) The Body of the loop: The statements, which are executed repeatedly while the test expression evaluates to true form the body of the loop. The syntax of the for loop is:
  • 38.  While Loop – The while loop is an entry-controlled loop. It means that the loop condition is tested before executing the loop body. If the loop condition is initially false, for the first iteration, then loop may not execute even once. The main characteristic of the while loop is that it can be used in both cases i.e. when the number of iterations is known as well as when it is unknown. The syntax of the while loop is as follows:
  • 39.  Do..While Loop - Do..While loop is an exit-controlled loop. In the do..while loop, the test occurs at the end of the loop. This ensures that the do..while loop executes the statements included in the loop body at least once. After the first execution of the statement, it evaluates the test expression. If the expression evaluates to true, then it executes the statements of the loop body again. Like if and while statements, the condition being checked must be included between parenthesis. The while statement must end with a semicolon. The syntax of the loop is as follows:
  • 40.  NetBeans is an IDE using which we can develop GUI applications in Java.  NetBeans provides various components used to create a GUI front-end  interface.  GUI components' appearance and behavior is controlled by their properties and methods.  We should use meaningful names for controls on the form and variables in the  code. It makes programming convenient.  Some useful Data Types supported in Java are: int, double, char and boolean.  String is an Object (reference) type supported in Java.  A variable must be declared before it can be used.  Different types of operators are available in Java. Operators are used to perform various operations on data.  Control Statements available in java are: if..else, switch..case, for, while, do..while.