SlideShare a Scribd company logo
1 of 10
Presentation on JTable
MD. Nazmul Hasan Sharif
ID:120025
Session:2012-13
Dep’t Of ICT
Comilla University
What is JTable
JTable is a component that displays rows and columns of data.
We can drag the cursor on column
boundaries to resize columns. We can also
drag a column to a new position. It can also
be possible to select a row,column, or cell
within the table and to change the data
Within a cell.
Class, interfaces and constructors
 JTable has many classes and interfaces associated with it. These are packaged in
javax.swing.table
 JTable does not provide any scrolling capabilities of its own. Instead, we will
normally wrap a JTable inside a JScrollPane.
 JTable supplies several constructors. The one used here is JTable(Object data[ ][ ],
Object colHeads[ ])
Here, data is a two-dimensional array of the information to be presented,
and colHeads is a one-dimensional array with the column headings.
Events Of JTable
A JTable can generate several different events.
The two most fundamental to a table’s operation are ListSelectionEvent and
TableModelEvent
ListSelectionEvent is generated when the user selects something in the table
TableModelEvent is fired when that table’s data changes in some way.
However, if we simply want to use JTable to display data (as the following example
does), then we don’t need to handle any events.
Steps for creating a simple table
Here are the steps required to set up a simple JTable that can be used to display data:
 1. Create an instance of JTable.
 2. Create a JScrollPane object, specifying the table as the object to scroll.
 3. Add the table to the scroll pane.
 4. Add the scroll pane to the content pane.
Models Of JTable
JTable relies on three models
1. TableModel : It is defined by the TableModel interface.
This model defines those things related to displaying data in a two-dimensional
format.
2. TableColumnModel
TableColumnModel that specifies the characteristics of a
column.
These two models are packaged in javax.swing.table
3. ListSelectionModel
The third model determines how items are selected.
Source Code
Output:
Thanks to all

More Related Content

What's hot

Pivot Table & Chart_Parakramesh Jaroli_Pacific University
Pivot Table & Chart_Parakramesh Jaroli_Pacific UniversityPivot Table & Chart_Parakramesh Jaroli_Pacific University
Pivot Table & Chart_Parakramesh Jaroli_Pacific UniversityParakramesh Jaroli
 
CREATING A DATASET FROM EXCEL IN POWER BI REPORT BUILDER
CREATING A DATASET FROM EXCEL IN POWER BI REPORT BUILDERCREATING A DATASET FROM EXCEL IN POWER BI REPORT BUILDER
CREATING A DATASET FROM EXCEL IN POWER BI REPORT BUILDERSagarDuttPhuloria
 
Tech Tip: Output Management System (OMS) in IBM SPSS Statistics
Tech Tip: Output Management System (OMS) in IBM SPSS StatisticsTech Tip: Output Management System (OMS) in IBM SPSS Statistics
Tech Tip: Output Management System (OMS) in IBM SPSS StatisticsVersion 1 Analytics
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & ChartsMS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Chartsdnbakhan
 
SAP BO Web Intelligence Basics
SAP BO Web Intelligence BasicsSAP BO Web Intelligence Basics
SAP BO Web Intelligence BasicsKiran Joy
 
Creating visual representations of time period data
Creating visual representations of time period dataCreating visual representations of time period data
Creating visual representations of time period dataQHRClinicalOps
 

What's hot (12)

Pivot Table & Chart_Parakramesh Jaroli_Pacific University
Pivot Table & Chart_Parakramesh Jaroli_Pacific UniversityPivot Table & Chart_Parakramesh Jaroli_Pacific University
Pivot Table & Chart_Parakramesh Jaroli_Pacific University
 
CREATING A DATASET FROM EXCEL IN POWER BI REPORT BUILDER
CREATING A DATASET FROM EXCEL IN POWER BI REPORT BUILDERCREATING A DATASET FROM EXCEL IN POWER BI REPORT BUILDER
CREATING A DATASET FROM EXCEL IN POWER BI REPORT BUILDER
 
Pivot table
Pivot tablePivot table
Pivot table
 
Tech Tip: Output Management System (OMS) in IBM SPSS Statistics
Tech Tip: Output Management System (OMS) in IBM SPSS StatisticsTech Tip: Output Management System (OMS) in IBM SPSS Statistics
Tech Tip: Output Management System (OMS) in IBM SPSS Statistics
 
MS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & ChartsMS Excel Pivot Table Reports & Charts
MS Excel Pivot Table Reports & Charts
 
Charts and pivot tables
Charts and pivot tablesCharts and pivot tables
Charts and pivot tables
 
Ppt on pivot table
Ppt on pivot tablePpt on pivot table
Ppt on pivot table
 
Pivot Table | Statistics
Pivot Table | StatisticsPivot Table | Statistics
Pivot Table | Statistics
 
Excel Pivot Tables
Excel Pivot TablesExcel Pivot Tables
Excel Pivot Tables
 
SAP BO Web Intelligence Basics
SAP BO Web Intelligence BasicsSAP BO Web Intelligence Basics
SAP BO Web Intelligence Basics
 
Creating visual representations of time period data
Creating visual representations of time period dataCreating visual representations of time period data
Creating visual representations of time period data
 
Exercise 6
Exercise 6Exercise 6
Exercise 6
 

Similar to Java presentation

simio_HW.DS_Storesimio_HWHW4.JPGsimio_HWModel7.1.pdf.docx
simio_HW.DS_Storesimio_HWHW4.JPGsimio_HWModel7.1.pdf.docxsimio_HW.DS_Storesimio_HWHW4.JPGsimio_HWModel7.1.pdf.docx
simio_HW.DS_Storesimio_HWHW4.JPGsimio_HWModel7.1.pdf.docxbudabrooks46239
 
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdfNitish Nagar
 
Tolerance Stackups Using Oracle Crystal Ball
Tolerance Stackups Using Oracle Crystal BallTolerance Stackups Using Oracle Crystal Ball
Tolerance Stackups Using Oracle Crystal BallRamon Balisnomo
 
SACRAO Presentation T4.3.pdf
SACRAO Presentation T4.3.pdfSACRAO Presentation T4.3.pdf
SACRAO Presentation T4.3.pdfPeputraHiring
 
27 Excel Hacks to Make You a Superstar
27 Excel Hacks to Make You a Superstar27 Excel Hacks to Make You a Superstar
27 Excel Hacks to Make You a SuperstarAlan Murray
 
Focusing on specific data by using filterss
Focusing on specific data by using filterssFocusing on specific data by using filterss
Focusing on specific data by using filterssum5ashm
 
Basics of excel for beginners
Basics of excel for beginnersBasics of excel for beginners
Basics of excel for beginnersJitesh Khushalani
 
computer applications in business unit 3
computer applications in business unit 3computer applications in business unit 3
computer applications in business unit 3Dr T.Sivakami
 
Itm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers keyItm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers keySong Love
 
PATTERNS08 - Strong Typing and Data Validation in .NET
PATTERNS08 - Strong Typing and Data Validation in .NETPATTERNS08 - Strong Typing and Data Validation in .NET
PATTERNS08 - Strong Typing and Data Validation in .NETMichael Heron
 
OBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - TutorialOBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - Tutorialonlinetrainingplacements
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2webhostingguy
 

Similar to Java presentation (20)

Microsoft Excel Tutorial
Microsoft Excel TutorialMicrosoft Excel Tutorial
Microsoft Excel Tutorial
 
simio_HW.DS_Storesimio_HWHW4.JPGsimio_HWModel7.1.pdf.docx
simio_HW.DS_Storesimio_HWHW4.JPGsimio_HWModel7.1.pdf.docxsimio_HW.DS_Storesimio_HWHW4.JPGsimio_HWModel7.1.pdf.docx
simio_HW.DS_Storesimio_HWHW4.JPGsimio_HWModel7.1.pdf.docx
 
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
4b6c1c5c-e913-4bbf-b3a4-41e23cb961ba-161004200047.pdf
 
Java swing
Java swingJava swing
Java swing
 
Tolerance Stackups Using Oracle Crystal Ball
Tolerance Stackups Using Oracle Crystal BallTolerance Stackups Using Oracle Crystal Ball
Tolerance Stackups Using Oracle Crystal Ball
 
Advanced Excel ppt
Advanced Excel pptAdvanced Excel ppt
Advanced Excel ppt
 
SACRAO Presentation T4.3.pdf
SACRAO Presentation T4.3.pdfSACRAO Presentation T4.3.pdf
SACRAO Presentation T4.3.pdf
 
27 Excel Hacks to Make You a Superstar
27 Excel Hacks to Make You a Superstar27 Excel Hacks to Make You a Superstar
27 Excel Hacks to Make You a Superstar
 
Focusing on specific data by using filterss
Focusing on specific data by using filterssFocusing on specific data by using filterss
Focusing on specific data by using filterss
 
Basics of excel for beginners
Basics of excel for beginnersBasics of excel for beginners
Basics of excel for beginners
 
computer applications in business unit 3
computer applications in business unit 3computer applications in business unit 3
computer applications in business unit 3
 
MS Excel 2013
MS Excel 2013MS Excel 2013
MS Excel 2013
 
Excel booklet
Excel bookletExcel booklet
Excel booklet
 
Itm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers keyItm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers key
 
PATTERNS08 - Strong Typing and Data Validation in .NET
PATTERNS08 - Strong Typing and Data Validation in .NETPATTERNS08 - Strong Typing and Data Validation in .NET
PATTERNS08 - Strong Typing and Data Validation in .NET
 
OBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - TutorialOBIEE publisher with Report creation - Tutorial
OBIEE publisher with Report creation - Tutorial
 
Jide grids developer_guide
Jide grids developer_guideJide grids developer_guide
Jide grids developer_guide
 
Introduction to MySQL - Part 2
Introduction to MySQL - Part 2Introduction to MySQL - Part 2
Introduction to MySQL - Part 2
 
Visual basic bt0082
Visual basic  bt0082Visual basic  bt0082
Visual basic bt0082
 
Excel Training
Excel TrainingExcel Training
Excel Training
 

Recently uploaded

handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailingAshishSingh1301
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsMathias Magdowski
 
Intro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniIntro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniR. Sosa
 
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTUUNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTUankushspencer015
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfKira Dess
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...archanaece3
 
Working Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfWorking Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfSkNahidulIslamShrabo
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfragupathi90
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..MaherOthman7
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligencemahaffeycheryld
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxMustafa Ahmed
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxkalpana413121
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfssuser5c9d4b1
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Toolssoginsider
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
Independent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging StationIndependent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging Stationsiddharthteach18
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashidFaiyazSheikh
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1T.D. Shashikala
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docxrahulmanepalli02
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...drjose256
 

Recently uploaded (20)

handbook on reinforce concrete and detailing
handbook on reinforce concrete and detailinghandbook on reinforce concrete and detailing
handbook on reinforce concrete and detailing
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 
Intro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney UniIntro to Design (for Engineers) at Sydney Uni
Intro to Design (for Engineers) at Sydney Uni
 
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTUUNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
UNIT-2 image enhancement.pdf Image Processing Unit 2 AKTU
 
Artificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdfArtificial intelligence presentation2-171219131633.pdf
Artificial intelligence presentation2-171219131633.pdf
 
5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...5G and 6G refer to generations of mobile network technology, each representin...
5G and 6G refer to generations of mobile network technology, each representin...
 
Working Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdfWorking Principle of Echo Sounder and Doppler Effect.pdf
Working Principle of Echo Sounder and Doppler Effect.pdf
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..Maher Othman Interior Design Portfolio..
Maher Othman Interior Design Portfolio..
 
Artificial Intelligence in due diligence
Artificial Intelligence in due diligenceArtificial Intelligence in due diligence
Artificial Intelligence in due diligence
 
Dynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptxDynamo Scripts for Task IDs and Space Naming.pptx
Dynamo Scripts for Task IDs and Space Naming.pptx
 
UNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptxUNIT 4 PTRP final Convergence in probability.pptx
UNIT 4 PTRP final Convergence in probability.pptx
 
Software Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdfSoftware Engineering Practical File Front Pages.pdf
Software Engineering Practical File Front Pages.pdf
 
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and ToolsMaximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
Maximizing Incident Investigation Efficacy in Oil & Gas: Techniques and Tools
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Independent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging StationIndependent Solar-Powered Electric Vehicle Charging Station
Independent Solar-Powered Electric Vehicle Charging Station
 
Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx21P35A0312 Internship eccccccReport.docx
21P35A0312 Internship eccccccReport.docx
 
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
Tembisa Central Terminating Pills +27838792658 PHOMOLONG Top Abortion Pills F...
 

Java presentation

  • 1. Presentation on JTable MD. Nazmul Hasan Sharif ID:120025 Session:2012-13 Dep’t Of ICT Comilla University
  • 2. What is JTable JTable is a component that displays rows and columns of data. We can drag the cursor on column boundaries to resize columns. We can also drag a column to a new position. It can also be possible to select a row,column, or cell within the table and to change the data Within a cell.
  • 3. Class, interfaces and constructors  JTable has many classes and interfaces associated with it. These are packaged in javax.swing.table  JTable does not provide any scrolling capabilities of its own. Instead, we will normally wrap a JTable inside a JScrollPane.  JTable supplies several constructors. The one used here is JTable(Object data[ ][ ], Object colHeads[ ]) Here, data is a two-dimensional array of the information to be presented, and colHeads is a one-dimensional array with the column headings.
  • 4. Events Of JTable A JTable can generate several different events. The two most fundamental to a table’s operation are ListSelectionEvent and TableModelEvent ListSelectionEvent is generated when the user selects something in the table TableModelEvent is fired when that table’s data changes in some way. However, if we simply want to use JTable to display data (as the following example does), then we don’t need to handle any events.
  • 5. Steps for creating a simple table Here are the steps required to set up a simple JTable that can be used to display data:  1. Create an instance of JTable.  2. Create a JScrollPane object, specifying the table as the object to scroll.  3. Add the table to the scroll pane.  4. Add the scroll pane to the content pane.
  • 6. Models Of JTable JTable relies on three models 1. TableModel : It is defined by the TableModel interface. This model defines those things related to displaying data in a two-dimensional format. 2. TableColumnModel TableColumnModel that specifies the characteristics of a column. These two models are packaged in javax.swing.table 3. ListSelectionModel The third model determines how items are selected.
  • 8.