Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Object-Oriented and Concurrent Programming What methods does JTable implement wh

ID: 3666830 • Letter: O

Question

Object-Oriented and Concurrent Programming What methods does JTable implement which are required by the interfaces implemented by the JTable class beyond those interfaces implemented by the various parent classes of JTable? please don't just copy something off the internet and answer the question. This has to be in your own words and not a long rambling from a website or documentation. (The teacher also has access to the internet sites you're copying from) Please no handwritten documents as answers to question I am having a hard time reading handwritten documents. Thank you for your help

Explanation / Answer

JTable :

We have to use the JTable in order to make the table for our program. The JTable is basically placed inside of a JScrollPan. In order to use JTable usable we need to import the below statement.

Import javax.swing.JTable;

Then create JTable variable,

JTable jTableVariable;

Then we need to create columns and rows which give you two dimensional arrays.

Use constructer to create those columns and rows

Following simple program tells JTable usage:

Import java.awt.Dimension;

Import javax.swing.JPanel;

Import javax.swing.JScrollPane;

Import javax.swing.JTable;

public class Tutorial extends JPanel {

JTable jt;

Public Tutorial(){

String[] columns = {“Name”, ”Age”, “Gender”};

String[][] data = {{“John”, “18”, “Male”},

{“Daisy”, “19”, “Female”},

{“Dave”, “23”, “Male”},

{“Jake”, “30”, “Male”}};

Jt = new JTable(data, columns);

Jt.setPreferredScrollableViewPortSize(new Dimension(450, 63));

Jt.setFillsViewPortHeight(true);

JScrollPane jps = new JScrollpane(jt);

Add(jps);

}

Public static void main(String[] args){

JFrame jt = new JFram();

Tutorial t = new Tutorial();

Jf.setTitle(“Tutorial”);

Jf.setSize(500, 500);

Jf.setVisible(true);

Jf.setDeafultCloseOperation(JFrame.EXIT_ON_CLOSE);

Jf.add(t);

}

}