SlideShare ist ein Scribd-Unternehmen logo
1 von 6
Downloaden Sie, um offline zu lesen
Core Java

Debasish Pratihari

Button Class
Constructor:
 public Button () Constructs a Button with no
label.
 public Button(String caption)  Constructs a
Button with label as specified by the caption
argument.
Methods :
 Sets the



public void setLabel(String label)



button lable as specified.
public String getLabel() Returns the button
label or null if no label is in the button.



public Label(String text)




Label Class
 constructs an label
with specified string
public Label( )  constructs an empty label
public Label(String text , int alignment) 
constructs a new label with specified string and
specified alignment.The alignment constants are
Label.LEFT,Label.RIGHT,Label.CENTER

Methods :
 public void setText(String text)sets the text for
the label as specified.
 public String getText( ) returns the label of the
Label.

Choice class (Combo box Control)
Constructor
 public Choice( )  creates a new Combo box with no item
Methods
 public s void add(String item)  adds an item to the
Combo
 public void addItem(String item)  adds an item to the
Combo
 public int getItemCount( ) returns the no. of
 public String getItem(int index)  returns a string at the
specified index in the choice menu
 public int getSelectedIndex( ) returns the index of the
currently selected item in the Choice menu.
 public synchronized String getSelectedItem( )  returns
a String representation of currently selected item from the
choice menu

Lecture/core/awt2/14

Page #1

feel the Technology…
Core Java

Debasish Pratihari

TextField class
Constructor





public TextField() 
creates
public TextField(String text)

a TextField
creates a new
text field initialized with specifies text
public TextField (int columns) constructs a new
empty text field with specified no. of columns
public TextField(String text , int columns)
constructs a new text field initialized with the
specified
string and wide enough to hold the
specified string

Methods






public void setEchoChar(char

c)

 sets the echo

character for this text field
public char getEchoChar()  gets the echo
character for the text field
public void setColumns(int col)  sets the no. of
columns for the text field
public int getColumns( )  returns the no of
columns in the text field
public void setEditable(boolean b)  Sets the
component to be editable or not if b is true then
editable otherwise not editable.
TextArea class

Constructor :
 public TextArea( )  constructs a new text area
 public TextArea(String text)  constructs a new

text area with specified text

row ,int col)  constructs a
text area with specified no. of rows and columns



public TextArea( int



public TextArea(String



public TextArea(String text, int row , int col,, int
scrollbar)
 constructs a text area with specified

text

,int

rows ,int

cols)

 constructs a text area with specified no. of rows
and columns initializes the text specified.
text & with cols & rows and scroll bar visibility as
specified the constant for scrollbars argument are
o
o
o
o

SCROLLBARS_BOTH
SCROLLBARS_VERTICAL_ONLY
SCROLLBARS_HORIZONTAL_ONLY
SCROLLBARS_NONE

Lecture/core/awt2/14

Page #2

feel the Technology…
Core Java

Debasish Pratihari

Checkbox class
Constructors


public Checkbox()  creates a checkbox with no



public Checkbox( String





label and state is set to “off”

label)  creates a
checkbox with the specified label as specified and
state is set to “off”
public Checkbox( String label , boolean state)
creates a checkbox with a specified label and the
state of checkbox Is as specified in the Boolean
argument, true for on state & table For “off” state.
public Checkbox(String label , boolean state ,
CheckboxGroup g) creates a checkbox with

specified label,and State as specified and combined
to a checkbox Group class


public Checkbox(String label ,CheckboxGroup
boolean state)- Same use as above.

g ,

Methods





label)  sets a label
for the check box specified
public String getLabel( )  gets the label of this
checkbox as specified
public void setState(boolean state) sets the state
of this checkbox true for “on” & false for “off”
public Boolean getState( )  returns Boolean that
represent the state of this checkbox returns true if
“on” & false is “off”
public void setLabel(String

Container class
Methods:









public Component add(Component comp)  adds the
specified component to the container.
public Component add(Component comp, int
alignment)  adds the component and follows the
alignment as specified.
public void remove(Component comp)  removes the
specified component form the container.
public int getComponentCount() returns the no of
components in the container.
public Component[ ] getComponents() returns an
array containing the components in the container.
public void removeAll() removes all the components
from the container.
public void setLayout(LayoutManager mgr)  sets
the layout for this container.

Lecture/core/awt2/14

Page #3

feel the Technology…
Core Java

Debasish Pratihari

Component class


public setVisible (boolean b)  if b is true then shows
the component otherwise hide it.



public void setSize(int width, int height)  resizes
the component to the specified size.



public void setBounds(int x, int y, int width, int
height)  moves the component to the corresponding
width and height.



public void setLocation(int x, int y)  Moves this
component to new location.



public void setName (String name)  Sets the name
of the component to the specified string.



public String getName() Returns a String object
representing the component name.



public void setForeground(Color c)  Sets the
foreground color to the component.



public Color getForeground () Returns the Color
object specifying the color of the component.



public void setFont (Font f) Sets the font for the
component name.



public Font getFont() Returns the font of this
component.



publilc void setEnable(boolean b)  Enables/disables
the component if b is true/false.



public boolean isEnable() Returns true if the
component is enable otherwise false.



public void setCursor(Cursor c)  Sets the cursor to
the component.



public Cursor getCursor() Returns the cursor set for
this component.



public void setBackground(Color c)  Sets the
background color for component.



public Color getBackground() Returns the color
object specifying the color set for the component.



public void repaint() Repaints the component.



public void add(PopupMenu popup)  adds a popup
menu for the component.



public void remove(PopupMenu popup)  Removes
the particular popup menu from the component.



public void Paint(Graphics g)  paints the component
to use this we need to override the method.

Lecture/core/awt2/14

Page #4

feel the Technology…
Core Java

Debasish Pratihari

Frame class
Constructor
 public Frame( )creates a new invisible frame .
 public Frame(String title)creates a new frame with
title as specified.
Methods
 public void setTitle(String title) sets the title of the
frame
 public String getTitle( )returns the title of the frame.
 public void setResizable(boolean resize)sets the
resizeable flag which determines whether this frame is
resizable or not.
 public boolean isResizable()returns true if the frame
is resizable or not.
 public void setMenuBar(MenuBar mb)sets the
menu bar for this frame.
 public MenuBar getMenuBar( )returns the menu bar
for this frame or null if frame doesnot have any menu bar.
 public void remove(MenuComponent m)removes
the specified menu bar from this frame.
 public setCursor(int cursoe_type)sets the cursor
for the frame

Dialog class
Constuctors:
 public Dialog(Frame parent)creates an invisible
dialog with empty title.
 public Dialog(Frame parent ,boolean
modal)creates an invisible dialog with an empty title
and modal depending on modal=true/false.
 public Dialog(Frame parent , String title)constructs
an invisible dialog with specified title.
 public Dialog(Frame parent , String title , boolean
modal)constructs an invisible dialog with specified title
and modal state with specified mode=true/false value.
Methods:
 public void setModal(boolean b)sets the dialog as
modalif bis true otherwise not.
 public boolean isModal()returns true if the dialog is
modal dialog.
 public void setTitle(String title)sets the title of the
dialog.
 public void setResizable(boolean b)if b=true then
the dialog box is set to resizable otherwise not.
 public boolean isResizable( )returns true if it is
resizable.
 public String getTitle( )returns the title of the dialog.

Lecture/core/awt2/14

Page #5

feel the Technology…
Core Java

Debasish Pratihari

FileDialog class
Constructors:


public FileDialog(Frame parent)creates a file dialog
for loading a file with an empty title.



public FileDialog(Frame parent , String
title)creates a file dialog with a specified title for
loading a file ,the files are shown in the current directory



public FileDialog(Frame parent,String title,int
mode)create a file dialog with specified title for loading
and saving a file if the value of mode=LOAD the file
dialog is finding a file to read, if mode=SAVE then file
dialog is finding a place to write a file.

Methods:


public String getDirectory( )gets the directory for
this file dialog



public void setDirectory(String

dir)sets the

directory of this file dialog to be the specified directory.


public String getFile( )returns the currently selected
file of the file dialog or null if no file is selected.



public void setFile(String file)sets the selected file
for the file dialog to be the specified file.



public int getMode()indicates whether the file dialog
is for loading or saving.



public void setMode(int mode)sets the mode
mode=FileDialog.LOAD or FileDialog.SAVE

Panel class
Constructors:


public Panel()creates a new panel using default
layout manager.the default layout is FlowLayout.



public Panel(LayoutManager mgr)creates a new
panel with specified layout manager.

Lecture/core/awt2/14

Page #6

feel the Technology…

Weitere ähnliche Inhalte

Andere mochten auch

The Eastern Origins Of Western Civilization Editted
The Eastern Origins Of Western Civilization EdittedThe Eastern Origins Of Western Civilization Editted
The Eastern Origins Of Western Civilization Edittedguestecd0c6
 
Pedalando - 09.12.07
Pedalando - 09.12.07Pedalando - 09.12.07
Pedalando - 09.12.07Jubrac Jacui
 
My Mom On Leadership
My Mom On LeadershipMy Mom On Leadership
My Mom On LeadershipMaja Vujovic
 
香港六合彩
香港六合彩香港六合彩
香港六合彩wejia
 
GDP-ivi9 What's new in the open source demo platform for automotive
GDP-ivi9 What's new in the open source demo platform for automotiveGDP-ivi9 What's new in the open source demo platform for automotive
GDP-ivi9 What's new in the open source demo platform for automotiveAgustin Benito Bethencourt
 
Google既有商業模式的破壞者3
Google既有商業模式的破壞者3Google既有商業模式的破壞者3
Google既有商業模式的破壞者3guestc1eec3
 
Javaday 2007: skype4java
Javaday 2007: skype4javaJavaday 2007: skype4java
Javaday 2007: skype4javaMatteo Baccan
 
Learning Pool Social Care Seminar - Cardiff
Learning Pool Social Care Seminar - CardiffLearning Pool Social Care Seminar - Cardiff
Learning Pool Social Care Seminar - CardiffPaul McElvaney
 
Developing Policy for Emerging Technologies
Developing Policy for Emerging TechnologiesDeveloping Policy for Emerging Technologies
Developing Policy for Emerging TechnologiesLovisa Williams
 
The shifting art of animal breeding
The shifting art of animal breedingThe shifting art of animal breeding
The shifting art of animal breedingSijne Van der Beek
 
Niver Flavia - 26.08.07
Niver Flavia - 26.08.07Niver Flavia - 26.08.07
Niver Flavia - 26.08.07Jubrac Jacui
 
Dave Briggs - Engaging Change
Dave Briggs - Engaging ChangeDave Briggs - Engaging Change
Dave Briggs - Engaging ChangePaul McElvaney
 
Codemotion 2012 : Sphinx: Open Source Search Server
Codemotion 2012 : Sphinx: Open Source Search ServerCodemotion 2012 : Sphinx: Open Source Search Server
Codemotion 2012 : Sphinx: Open Source Search ServerMatteo Baccan
 

Andere mochten auch (20)

The Eastern Origins Of Western Civilization Editted
The Eastern Origins Of Western Civilization EdittedThe Eastern Origins Of Western Civilization Editted
The Eastern Origins Of Western Civilization Editted
 
Guia de blogger
Guia de bloggerGuia de blogger
Guia de blogger
 
Pedalando - 09.12.07
Pedalando - 09.12.07Pedalando - 09.12.07
Pedalando - 09.12.07
 
Acampa2007
Acampa2007Acampa2007
Acampa2007
 
My Mom On Leadership
My Mom On LeadershipMy Mom On Leadership
My Mom On Leadership
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
GDP-ivi9 What's new in the open source demo platform for automotive
GDP-ivi9 What's new in the open source demo platform for automotiveGDP-ivi9 What's new in the open source demo platform for automotive
GDP-ivi9 What's new in the open source demo platform for automotive
 
Google既有商業模式的破壞者3
Google既有商業模式的破壞者3Google既有商業模式的破壞者3
Google既有商業模式的破壞者3
 
Javaday 2007: skype4java
Javaday 2007: skype4javaJavaday 2007: skype4java
Javaday 2007: skype4java
 
It is All True
It is All TrueIt is All True
It is All True
 
Learning Pool Social Care Seminar - Cardiff
Learning Pool Social Care Seminar - CardiffLearning Pool Social Care Seminar - Cardiff
Learning Pool Social Care Seminar - Cardiff
 
Developing Policy for Emerging Technologies
Developing Policy for Emerging TechnologiesDeveloping Policy for Emerging Technologies
Developing Policy for Emerging Technologies
 
The shifting art of animal breeding
The shifting art of animal breedingThe shifting art of animal breeding
The shifting art of animal breeding
 
Niver Flavia - 26.08.07
Niver Flavia - 26.08.07Niver Flavia - 26.08.07
Niver Flavia - 26.08.07
 
Lecture 17
Lecture 17Lecture 17
Lecture 17
 
Dave Briggs - Engaging Change
Dave Briggs - Engaging ChangeDave Briggs - Engaging Change
Dave Briggs - Engaging Change
 
Scmad Chapter08
Scmad Chapter08Scmad Chapter08
Scmad Chapter08
 
Codemotion 2012 : Sphinx: Open Source Search Server
Codemotion 2012 : Sphinx: Open Source Search ServerCodemotion 2012 : Sphinx: Open Source Search Server
Codemotion 2012 : Sphinx: Open Source Search Server
 
Passive voice
Passive voicePassive voice
Passive voice
 
Libre Software Communities and Universities
Libre Software Communities and UniversitiesLibre Software Communities and Universities
Libre Software Communities and Universities
 

Ähnlich wie Lecture 14

DSJ_Unit III.pdf
DSJ_Unit III.pdfDSJ_Unit III.pdf
DSJ_Unit III.pdfArumugam90
 
do it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docxdo it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docxjameywaughj
 
Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxjosephineboon366
 
Google guava - almost everything you need to know
Google guava - almost everything you need to knowGoogle guava - almost everything you need to know
Google guava - almost everything you need to knowTomasz Dziurko
 
Language fundamentals ocjp
Language fundamentals ocjpLanguage fundamentals ocjp
Language fundamentals ocjpBhavishya sharma
 
New features and enhancement
New features and enhancementNew features and enhancement
New features and enhancementRakesh Madugula
 
Unit-1 awt advanced java programming
Unit-1 awt advanced java programmingUnit-1 awt advanced java programming
Unit-1 awt advanced java programmingAmol Gaikwad
 
Dr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDrRajeshreeKhande
 
Java Generics
Java GenericsJava Generics
Java Genericsjeslie
 
awt controls .pptx
awt controls .pptxawt controls .pptx
awt controls .pptxAnsarTp1
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guidekrtioplal
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat SheetHortonworks
 
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsbabhishekmathuroffici
 

Ähnlich wie Lecture 14 (20)

DSJ_Unit III.pdf
DSJ_Unit III.pdfDSJ_Unit III.pdf
DSJ_Unit III.pdf
 
Java swing
Java swingJava swing
Java swing
 
AWT New-3.pptx
AWT New-3.pptxAWT New-3.pptx
AWT New-3.pptx
 
do it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docxdo it in eclips and make sure it compile Goals1)Be able to.docx
do it in eclips and make sure it compile Goals1)Be able to.docx
 
Bean Intro
Bean IntroBean Intro
Bean Intro
 
Goals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docxGoals1)Be able to work with individual bits in java.2).docx
Goals1)Be able to work with individual bits in java.2).docx
 
Google guava - almost everything you need to know
Google guava - almost everything you need to knowGoogle guava - almost everything you need to know
Google guava - almost everything you need to know
 
Java awt
Java awtJava awt
Java awt
 
CORE JAVA-2
CORE JAVA-2CORE JAVA-2
CORE JAVA-2
 
Language fundamentals ocjp
Language fundamentals ocjpLanguage fundamentals ocjp
Language fundamentals ocjp
 
New features and enhancement
New features and enhancementNew features and enhancement
New features and enhancement
 
Unit-1 awt advanced java programming
Unit-1 awt advanced java programmingUnit-1 awt advanced java programming
Unit-1 awt advanced java programming
 
Dr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWTDr. Rajeshree Khande :Introduction to Java AWT
Dr. Rajeshree Khande :Introduction to Java AWT
 
Java Generics
Java GenericsJava Generics
Java Generics
 
awt controls .pptx
awt controls .pptxawt controls .pptx
awt controls .pptx
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guide
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat Sheet
 
Class 6 2ciclo
Class 6 2cicloClass 6 2ciclo
Class 6 2ciclo
 
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
3_ppt_Layout.pptxgßbdbdbdbsbsbsbbsbsbsbsbsb
 
‫Chapter3 inheritance
‫Chapter3 inheritance‫Chapter3 inheritance
‫Chapter3 inheritance
 

Mehr von Debasish Pratihari (19)

Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 
Lecture 22
Lecture 22Lecture 22
Lecture 22
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
Lecture 20
Lecture 20Lecture 20
Lecture 20
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
Lecture 16
Lecture 16Lecture 16
Lecture 16
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Lecture25
Lecture25Lecture25
Lecture25
 

Kürzlich hochgeladen

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Kürzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Lecture 14

  • 1. Core Java Debasish Pratihari Button Class Constructor:  public Button () Constructs a Button with no label.  public Button(String caption)  Constructs a Button with label as specified by the caption argument. Methods :  Sets the  public void setLabel(String label)  button lable as specified. public String getLabel() Returns the button label or null if no label is in the button.  public Label(String text)   Label Class  constructs an label with specified string public Label( )  constructs an empty label public Label(String text , int alignment)  constructs a new label with specified string and specified alignment.The alignment constants are Label.LEFT,Label.RIGHT,Label.CENTER Methods :  public void setText(String text)sets the text for the label as specified.  public String getText( ) returns the label of the Label. Choice class (Combo box Control) Constructor  public Choice( )  creates a new Combo box with no item Methods  public s void add(String item)  adds an item to the Combo  public void addItem(String item)  adds an item to the Combo  public int getItemCount( ) returns the no. of  public String getItem(int index)  returns a string at the specified index in the choice menu  public int getSelectedIndex( ) returns the index of the currently selected item in the Choice menu.  public synchronized String getSelectedItem( )  returns a String representation of currently selected item from the choice menu Lecture/core/awt2/14 Page #1 feel the Technology…
  • 2. Core Java Debasish Pratihari TextField class Constructor     public TextField()  creates public TextField(String text) a TextField creates a new text field initialized with specifies text public TextField (int columns) constructs a new empty text field with specified no. of columns public TextField(String text , int columns) constructs a new text field initialized with the specified string and wide enough to hold the specified string Methods      public void setEchoChar(char c)  sets the echo character for this text field public char getEchoChar()  gets the echo character for the text field public void setColumns(int col)  sets the no. of columns for the text field public int getColumns( )  returns the no of columns in the text field public void setEditable(boolean b)  Sets the component to be editable or not if b is true then editable otherwise not editable. TextArea class Constructor :  public TextArea( )  constructs a new text area  public TextArea(String text)  constructs a new text area with specified text row ,int col)  constructs a text area with specified no. of rows and columns  public TextArea( int  public TextArea(String  public TextArea(String text, int row , int col,, int scrollbar)  constructs a text area with specified text ,int rows ,int cols)  constructs a text area with specified no. of rows and columns initializes the text specified. text & with cols & rows and scroll bar visibility as specified the constant for scrollbars argument are o o o o SCROLLBARS_BOTH SCROLLBARS_VERTICAL_ONLY SCROLLBARS_HORIZONTAL_ONLY SCROLLBARS_NONE Lecture/core/awt2/14 Page #2 feel the Technology…
  • 3. Core Java Debasish Pratihari Checkbox class Constructors  public Checkbox()  creates a checkbox with no  public Checkbox( String   label and state is set to “off” label)  creates a checkbox with the specified label as specified and state is set to “off” public Checkbox( String label , boolean state) creates a checkbox with a specified label and the state of checkbox Is as specified in the Boolean argument, true for on state & table For “off” state. public Checkbox(String label , boolean state , CheckboxGroup g) creates a checkbox with specified label,and State as specified and combined to a checkbox Group class  public Checkbox(String label ,CheckboxGroup boolean state)- Same use as above. g , Methods     label)  sets a label for the check box specified public String getLabel( )  gets the label of this checkbox as specified public void setState(boolean state) sets the state of this checkbox true for “on” & false for “off” public Boolean getState( )  returns Boolean that represent the state of this checkbox returns true if “on” & false is “off” public void setLabel(String Container class Methods:        public Component add(Component comp)  adds the specified component to the container. public Component add(Component comp, int alignment)  adds the component and follows the alignment as specified. public void remove(Component comp)  removes the specified component form the container. public int getComponentCount() returns the no of components in the container. public Component[ ] getComponents() returns an array containing the components in the container. public void removeAll() removes all the components from the container. public void setLayout(LayoutManager mgr)  sets the layout for this container. Lecture/core/awt2/14 Page #3 feel the Technology…
  • 4. Core Java Debasish Pratihari Component class  public setVisible (boolean b)  if b is true then shows the component otherwise hide it.  public void setSize(int width, int height)  resizes the component to the specified size.  public void setBounds(int x, int y, int width, int height)  moves the component to the corresponding width and height.  public void setLocation(int x, int y)  Moves this component to new location.  public void setName (String name)  Sets the name of the component to the specified string.  public String getName() Returns a String object representing the component name.  public void setForeground(Color c)  Sets the foreground color to the component.  public Color getForeground () Returns the Color object specifying the color of the component.  public void setFont (Font f) Sets the font for the component name.  public Font getFont() Returns the font of this component.  publilc void setEnable(boolean b)  Enables/disables the component if b is true/false.  public boolean isEnable() Returns true if the component is enable otherwise false.  public void setCursor(Cursor c)  Sets the cursor to the component.  public Cursor getCursor() Returns the cursor set for this component.  public void setBackground(Color c)  Sets the background color for component.  public Color getBackground() Returns the color object specifying the color set for the component.  public void repaint() Repaints the component.  public void add(PopupMenu popup)  adds a popup menu for the component.  public void remove(PopupMenu popup)  Removes the particular popup menu from the component.  public void Paint(Graphics g)  paints the component to use this we need to override the method. Lecture/core/awt2/14 Page #4 feel the Technology…
  • 5. Core Java Debasish Pratihari Frame class Constructor  public Frame( )creates a new invisible frame .  public Frame(String title)creates a new frame with title as specified. Methods  public void setTitle(String title) sets the title of the frame  public String getTitle( )returns the title of the frame.  public void setResizable(boolean resize)sets the resizeable flag which determines whether this frame is resizable or not.  public boolean isResizable()returns true if the frame is resizable or not.  public void setMenuBar(MenuBar mb)sets the menu bar for this frame.  public MenuBar getMenuBar( )returns the menu bar for this frame or null if frame doesnot have any menu bar.  public void remove(MenuComponent m)removes the specified menu bar from this frame.  public setCursor(int cursoe_type)sets the cursor for the frame Dialog class Constuctors:  public Dialog(Frame parent)creates an invisible dialog with empty title.  public Dialog(Frame parent ,boolean modal)creates an invisible dialog with an empty title and modal depending on modal=true/false.  public Dialog(Frame parent , String title)constructs an invisible dialog with specified title.  public Dialog(Frame parent , String title , boolean modal)constructs an invisible dialog with specified title and modal state with specified mode=true/false value. Methods:  public void setModal(boolean b)sets the dialog as modalif bis true otherwise not.  public boolean isModal()returns true if the dialog is modal dialog.  public void setTitle(String title)sets the title of the dialog.  public void setResizable(boolean b)if b=true then the dialog box is set to resizable otherwise not.  public boolean isResizable( )returns true if it is resizable.  public String getTitle( )returns the title of the dialog. Lecture/core/awt2/14 Page #5 feel the Technology…
  • 6. Core Java Debasish Pratihari FileDialog class Constructors:  public FileDialog(Frame parent)creates a file dialog for loading a file with an empty title.  public FileDialog(Frame parent , String title)creates a file dialog with a specified title for loading a file ,the files are shown in the current directory  public FileDialog(Frame parent,String title,int mode)create a file dialog with specified title for loading and saving a file if the value of mode=LOAD the file dialog is finding a file to read, if mode=SAVE then file dialog is finding a place to write a file. Methods:  public String getDirectory( )gets the directory for this file dialog  public void setDirectory(String dir)sets the directory of this file dialog to be the specified directory.  public String getFile( )returns the currently selected file of the file dialog or null if no file is selected.  public void setFile(String file)sets the selected file for the file dialog to be the specified file.  public int getMode()indicates whether the file dialog is for loading or saving.  public void setMode(int mode)sets the mode mode=FileDialog.LOAD or FileDialog.SAVE Panel class Constructors:  public Panel()creates a new panel using default layout manager.the default layout is FlowLayout.  public Panel(LayoutManager mgr)creates a new panel with specified layout manager. Lecture/core/awt2/14 Page #6 feel the Technology…