SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Swing
Advanced
 Controls
JColorChooser
JColorChooser
     Constructors
           public JColorChooser()
           public JColorChooser(Color clr)
                  | Color clr = new Color(25,135,200);
JColorChooser
     Event Handling
           Retrieve ColorSelectionModel
                  Register ChangeListener object
                         Handle stateChanged method
JColorChooser
     Method
          Color getColor()
          void setColor()
          showDialog(Component, String, Color)
JList
JList
        Constructors
              public JList()
              public Jlist(Object[] items)
              public Jlist(Vector vecItems)
JList
        Event Handling
              Create Jlist
              Create JScrollPane and pass JList
              Add JScrollPane to container
JList
        Method
             public void setSelectionMode(int selectMode)
JList
        Method
             public void setLayoutOrientation(layoutOrient)
JList
        Method
             public void setVisibleRowCount(int count)
JList
        Event Handling
              Register ListSelectionListener
              Handle valueChanged() method
JList
        Method
             public void clearSelection()
             public int getSelectedIndex()
             public int[] getSelectedIndices()
             public boolean isSelectionEmpty()
JList
        Set and Select
               public void setListData(Object[] items)
               public void setSelectedIndex(int index)
               public void setSelectedIndices(int[]
indices)
JComboBox
JComboBox
    Constructors
          public JComboBox()
          public JComboBox(Object[] items)
          public JComboBox(Vector vecItems)
JComboBox
    Steps
            Create a instance of JComboBox
            Add it into container
JComboBox
    Event Handling
          Register ActionListener
                 Handle actionPerformed() method
          Register ItemListener
                 Handle itemStateChanged() method
JComboBox
    Method
         public void addItem(Object item)
         public int getItemCount()
         public int getSelectedIndex()
         public object getSelectedItem()
JComboBox
    Method
         public void setEditable(Boolean editable)
         public void setSelectedIndex(int index)
         public void setSelectedItem(Object item)
JTable
JTable
      Constructors
            public JTable()
            public JTable(int numRows, int numColumns)
            public JTable(Object[][] data, Object[]
column)
            public JTable(Vector data, Vector columns)
            public JTable(TableModel model)
JTable
     Display
JTable
      Drawbacks
             All columns are of same width by default
             Ellipsis is used for displaying data
             Horizontal scrolling will not be activated
because of ellipsis
JTable
     Creating a Custom JTable
           AbstractTableModel
           DefaultTableModel
AbstractTableModel
      public int getRowCount()
      public int getColumnCount()
      public Object getValueAt(int row, int column)

      fireTableDataChanged()
Steps:
         Instantiate data model class
         Instantiate JTable object
         setData()
Event Handling
      Register a MouseListener
             Handle mouseClicked() method
JTree
Constructing a JTree
       Create an instance of DefaultMutableTreeNode
       Create an instance of a JTree
Constructing a JTree
       Create DefaultMutableTreeNode instance
       Add branch nodes
       Add leaf nodes
       Enclose the tree in scrollpane
       Add scrollpane to frame
Constructing a JTree
Event Handling
      Register a TreeSelectionListener
             Handle valueChanged() method
      Register a TreeExpansionListener
             Handle treeExpanded() method
             Handle treeCollapsed() method
      Register a TreeWillExpandListener
             Handle treeWillExpand() method
             Handle treeWillCollapse() method
JTabbedPane
Constructing a JTabbedPane
      public JTabbedPane()
      public JTabbedPane(int placement)
Adding Tabs
        Create JTabbedPane instance
        Create JPanel instance for each tab
        Add the component in the respective panels
        Use the addTab() method of JTabbedPane to add the
panel
Event Handling
      Register a ChangeListener
             Handle stateChanged() method
JSplitPane
Constructing a JSplitPane
       public JSplitPane()
       public JSplitPane(int orientation)
       public JSplitPane(int, boolean)
       public JSplitPane(int, boolean, Component,
Component)
Methods
     void setOneTouchExpandable(boolean)
     void setDividerLocation(int)

Weitere ähnliche Inhalte

Andere mochten auch

Aplicaciones moviles gas
Aplicaciones   moviles gasAplicaciones   moviles gas
Aplicaciones moviles gasEdgar Morales
 
leadership theories
leadership theoriesleadership theories
leadership theoriesElu Jain
 
Grammar book Raquel
Grammar book RaquelGrammar book Raquel
Grammar book Raquelraquel63485
 
E-democracy: Comparison of opportunities in the Western Balkan countries
E-democracy: Comparison of opportunities in the Western Balkan countriesE-democracy: Comparison of opportunities in the Western Balkan countries
E-democracy: Comparison of opportunities in the Western Balkan countriesTomislav Korman
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsPablo Godel
 
Latin I Lesson 07
Latin I Lesson 07Latin I Lesson 07
Latin I Lesson 07polaramy
 
Climate chaos, policy dilemmas
Climate chaos, policy dilemmasClimate chaos, policy dilemmas
Climate chaos, policy dilemmasfutureagricultures
 
เบาหวาน+~..
เบาหวาน+~..เบาหวาน+~..
เบาหวาน+~..maygaclever
 
10 planete infricosatoare
10 planete infricosatoare10 planete infricosatoare
10 planete infricosatoarebalada65
 
MONTEFARMACO_INTERNO_Position_Paper_Lactoflorene_DEF_10112016
MONTEFARMACO_INTERNO_Position_Paper_Lactoflorene_DEF_10112016MONTEFARMACO_INTERNO_Position_Paper_Lactoflorene_DEF_10112016
MONTEFARMACO_INTERNO_Position_Paper_Lactoflorene_DEF_10112016Giorgio Cassarà
 
Nuova Legge 266 Programma 2011
Nuova Legge 266 Programma 2011Nuova Legge 266 Programma 2011
Nuova Legge 266 Programma 2011MeMeEsposito
 
PDF Scanning environment for startegic intervention for youth
PDF Scanning environment for startegic intervention for youthPDF Scanning environment for startegic intervention for youth
PDF Scanning environment for startegic intervention for youthMosharaf Hossain
 

Andere mochten auch (16)

Aplicaciones moviles gas
Aplicaciones   moviles gasAplicaciones   moviles gas
Aplicaciones moviles gas
 
leadership theories
leadership theoriesleadership theories
leadership theories
 
Grammar book Raquel
Grammar book RaquelGrammar book Raquel
Grammar book Raquel
 
Dataspace presentatie
Dataspace presentatieDataspace presentatie
Dataspace presentatie
 
La maga mil
La maga mil La maga mil
La maga mil
 
E-democracy: Comparison of opportunities in the Western Balkan countries
E-democracy: Comparison of opportunities in the Western Balkan countriesE-democracy: Comparison of opportunities in the Western Balkan countries
E-democracy: Comparison of opportunities in the Western Balkan countries
 
Rock Solid Deployment of Web Applications
Rock Solid Deployment of Web ApplicationsRock Solid Deployment of Web Applications
Rock Solid Deployment of Web Applications
 
Latin I Lesson 07
Latin I Lesson 07Latin I Lesson 07
Latin I Lesson 07
 
Climate chaos, policy dilemmas
Climate chaos, policy dilemmasClimate chaos, policy dilemmas
Climate chaos, policy dilemmas
 
เบาหวาน+~..
เบาหวาน+~..เบาหวาน+~..
เบาหวาน+~..
 
Question 1
Question 1Question 1
Question 1
 
10 planete infricosatoare
10 planete infricosatoare10 planete infricosatoare
10 planete infricosatoare
 
MONTEFARMACO_INTERNO_Position_Paper_Lactoflorene_DEF_10112016
MONTEFARMACO_INTERNO_Position_Paper_Lactoflorene_DEF_10112016MONTEFARMACO_INTERNO_Position_Paper_Lactoflorene_DEF_10112016
MONTEFARMACO_INTERNO_Position_Paper_Lactoflorene_DEF_10112016
 
Notam 28 set
Notam 28 setNotam 28 set
Notam 28 set
 
Nuova Legge 266 Programma 2011
Nuova Legge 266 Programma 2011Nuova Legge 266 Programma 2011
Nuova Legge 266 Programma 2011
 
PDF Scanning environment for startegic intervention for youth
PDF Scanning environment for startegic intervention for youthPDF Scanning environment for startegic intervention for youth
PDF Scanning environment for startegic intervention for youth
 

Ähnlich wie Module 4

Advanced java programming
Advanced java programmingAdvanced java programming
Advanced java programmingKaviya452563
 
13 advanced-swing
13 advanced-swing13 advanced-swing
13 advanced-swingNataraj Dg
 
12advanced Swing
12advanced Swing12advanced Swing
12advanced SwingAdil Jafri
 
Unit-1 awt advanced java programming
Unit-1 awt advanced java programmingUnit-1 awt advanced java programming
Unit-1 awt advanced java programmingAmol Gaikwad
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Juan Pablo
 
Commonality and Variability Analysis: Avoiding Duplicate Code
Commonality and Variability Analysis: Avoiding Duplicate CodeCommonality and Variability Analysis: Avoiding Duplicate Code
Commonality and Variability Analysis: Avoiding Duplicate CodeAlistair McKinnell
 
01 Java Is Architecture Neutral
01 Java Is Architecture Neutral01 Java Is Architecture Neutral
01 Java Is Architecture Neutralrajuglobal
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5sotlsoc
 
Model View Intent on Android
Model View Intent on AndroidModel View Intent on Android
Model View Intent on AndroidCody Engel
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2PRN USM
 
Fabric.js @ Falsy Values
Fabric.js @ Falsy ValuesFabric.js @ Falsy Values
Fabric.js @ Falsy ValuesJuriy Zaytsev
 

Ähnlich wie Module 4 (20)

Advanced java programming
Advanced java programmingAdvanced java programming
Advanced java programming
 
Swing basics
Swing basicsSwing basics
Swing basics
 
13 advanced-swing
13 advanced-swing13 advanced-swing
13 advanced-swing
 
Jp notes
Jp notesJp notes
Jp notes
 
Java awt
Java awtJava awt
Java awt
 
12advanced Swing
12advanced Swing12advanced Swing
12advanced Swing
 
Event handling
Event handlingEvent handling
Event handling
 
Unit-1 awt advanced java programming
Unit-1 awt advanced java programmingUnit-1 awt advanced java programming
Unit-1 awt advanced java programming
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#
 
Commonality and Variability Analysis: Avoiding Duplicate Code
Commonality and Variability Analysis: Avoiding Duplicate CodeCommonality and Variability Analysis: Avoiding Duplicate Code
Commonality and Variability Analysis: Avoiding Duplicate Code
 
Swing
SwingSwing
Swing
 
01 Java Is Architecture Neutral
01 Java Is Architecture Neutral01 Java Is Architecture Neutral
01 Java Is Architecture Neutral
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5
 
Java swing
Java swingJava swing
Java swing
 
Model View Intent on Android
Model View Intent on AndroidModel View Intent on Android
Model View Intent on Android
 
【Unity】Scriptable object 入門と活用例
【Unity】Scriptable object 入門と活用例【Unity】Scriptable object 入門と活用例
【Unity】Scriptable object 入門と活用例
 
Swing_Introduction.ppt
Swing_Introduction.pptSwing_Introduction.ppt
Swing_Introduction.ppt
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
Fabric.js @ Falsy Values
Fabric.js @ Falsy ValuesFabric.js @ Falsy Values
Fabric.js @ Falsy Values
 

Mehr von Tuan Ngo

Introduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enIntroduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enTuan Ngo
 
Net framework
Net frameworkNet framework
Net frameworkTuan Ngo
 
15 anonymous methods, partial types and nullable types
15   anonymous methods, partial types and nullable types15   anonymous methods, partial types and nullable types
15 anonymous methods, partial types and nullable typesTuan Ngo
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iteratorsTuan Ngo
 
13 collections
13   collections13   collections
13 collectionsTuan Ngo
 
11 exception handling
11   exception handling11   exception handling
11 exception handlingTuan Ngo
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegatesTuan Ngo
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexersTuan Ngo
 
10 namespace
10  namespace10  namespace
10 namespaceTuan Ngo
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces Tuan Ngo
 
7 inheritance and polymorphism
7   inheritance and polymorphism7   inheritance and polymorphism
7 inheritance and polymorphismTuan Ngo
 
6 class and methods
6    class and methods6    class and methods
6 class and methodsTuan Ngo
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operatorsTuan Ngo
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructsTuan Ngo
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#Tuan Ngo
 
2 variables and data types
2   variables and data types2   variables and data types
2 variables and data typesTuan Ngo
 

Mehr von Tuan Ngo (20)

Introduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enIntroduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 en
 
Net framework
Net frameworkNet framework
Net framework
 
15 anonymous methods, partial types and nullable types
15   anonymous methods, partial types and nullable types15   anonymous methods, partial types and nullable types
15 anonymous methods, partial types and nullable types
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iterators
 
13 collections
13   collections13   collections
13 collections
 
11 exception handling
11   exception handling11   exception handling
11 exception handling
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegates
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexers
 
10 namespace
10  namespace10  namespace
10 namespace
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces
 
7 inheritance and polymorphism
7   inheritance and polymorphism7   inheritance and polymorphism
7 inheritance and polymorphism
 
5 arrays
5   arrays5   arrays
5 arrays
 
6 class and methods
6    class and methods6    class and methods
6 class and methods
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operators
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructs
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#
 
2 variables and data types
2   variables and data types2   variables and data types
2 variables and data types
 
Jdbc 7
Jdbc 7Jdbc 7
Jdbc 7
 
Jdbc 6
Jdbc 6Jdbc 6
Jdbc 6
 
Jdbc 3
Jdbc 3Jdbc 3
Jdbc 3
 

Kürzlich hochgeladen

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
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
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 

Kürzlich hochgeladen (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
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
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 

Module 4

  • 3. JColorChooser Constructors public JColorChooser() public JColorChooser(Color clr) | Color clr = new Color(25,135,200);
  • 4. JColorChooser Event Handling Retrieve ColorSelectionModel Register ChangeListener object Handle stateChanged method
  • 5. JColorChooser Method Color getColor() void setColor() showDialog(Component, String, Color)
  • 7. JList Constructors public JList() public Jlist(Object[] items) public Jlist(Vector vecItems)
  • 8. JList Event Handling Create Jlist Create JScrollPane and pass JList Add JScrollPane to container
  • 9. JList Method public void setSelectionMode(int selectMode)
  • 10. JList Method public void setLayoutOrientation(layoutOrient)
  • 11. JList Method public void setVisibleRowCount(int count)
  • 12. JList Event Handling Register ListSelectionListener Handle valueChanged() method
  • 13. JList Method public void clearSelection() public int getSelectedIndex() public int[] getSelectedIndices() public boolean isSelectionEmpty()
  • 14. JList Set and Select public void setListData(Object[] items) public void setSelectedIndex(int index) public void setSelectedIndices(int[] indices)
  • 16. JComboBox Constructors public JComboBox() public JComboBox(Object[] items) public JComboBox(Vector vecItems)
  • 17. JComboBox Steps Create a instance of JComboBox Add it into container
  • 18. JComboBox Event Handling Register ActionListener Handle actionPerformed() method Register ItemListener Handle itemStateChanged() method
  • 19. JComboBox Method public void addItem(Object item) public int getItemCount() public int getSelectedIndex() public object getSelectedItem()
  • 20. JComboBox Method public void setEditable(Boolean editable) public void setSelectedIndex(int index) public void setSelectedItem(Object item)
  • 22. JTable Constructors public JTable() public JTable(int numRows, int numColumns) public JTable(Object[][] data, Object[] column) public JTable(Vector data, Vector columns) public JTable(TableModel model)
  • 23. JTable Display
  • 24. JTable Drawbacks All columns are of same width by default Ellipsis is used for displaying data Horizontal scrolling will not be activated because of ellipsis
  • 25. JTable Creating a Custom JTable AbstractTableModel DefaultTableModel
  • 26. AbstractTableModel public int getRowCount() public int getColumnCount() public Object getValueAt(int row, int column) fireTableDataChanged()
  • 27. Steps: Instantiate data model class Instantiate JTable object setData()
  • 28. Event Handling Register a MouseListener Handle mouseClicked() method
  • 29. JTree
  • 30. Constructing a JTree Create an instance of DefaultMutableTreeNode Create an instance of a JTree
  • 31. Constructing a JTree Create DefaultMutableTreeNode instance Add branch nodes Add leaf nodes Enclose the tree in scrollpane Add scrollpane to frame
  • 33. Event Handling Register a TreeSelectionListener Handle valueChanged() method Register a TreeExpansionListener Handle treeExpanded() method Handle treeCollapsed() method Register a TreeWillExpandListener Handle treeWillExpand() method Handle treeWillCollapse() method
  • 35. Constructing a JTabbedPane public JTabbedPane() public JTabbedPane(int placement)
  • 36. Adding Tabs Create JTabbedPane instance Create JPanel instance for each tab Add the component in the respective panels Use the addTab() method of JTabbedPane to add the panel
  • 37. Event Handling Register a ChangeListener Handle stateChanged() method
  • 39. Constructing a JSplitPane public JSplitPane() public JSplitPane(int orientation) public JSplitPane(int, boolean) public JSplitPane(int, boolean, Component, Component)
  • 40. Methods void setOneTouchExpandable(boolean) void setDividerLocation(int)