SlideShare a Scribd company logo
How do I make my JTable non editable?
import java.awt.*;
import javax.swing.table.*;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableModel;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import java.nio.*;
import java.nio.charset.Charset;
import java.nio.file.*;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.util.Scanner;
import java.util.StringTokenizer;
public class SwingDemo implements ActionListener, KeyListener
{
JLabel search, output;
JFrame viewer;
JTable table = new JTable(new DefaultTableModel(null, new Object []{"Row ID", "First
Name", "Last Name", "EMPLID", "GPA", "Venus Login"}));
JFrame viewerAdd;
DefaultTableModel model = (DefaultTableModel) table.getModel();
JTextField first = new JTextField(20);
JTextField last = new JTextField(20);
JTextField emplid = new JTextField(20);
JTextField gpa = new JTextField(20);
JTextField venus = new JTextField(10);
String Venus;
public static int rowCount = 1;
public final static int LOAD = 0;
public final static int SAVE = 1;
public SwingDemo()
{
//Creates Java Frame
viewer = new JFrame("Final Project");
viewer.setSize(570, 650);
viewer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
viewer.setLayout(new FlowLayout());
viewer.setLocationRelativeTo(viewer);
//Creates Drop Down Menu
String[] option = { "Row ID", "First Name", "Last Name", "EMPLID", "GPA", "Venus
Login" };
JComboBox options = new JComboBox(option);
options.setSelectedIndex(0);
//Creates Button and Labels
search = new JLabel("Search by: ");
JButton addButton = new JButton("Add");
JButton deleteButton = new JButton("Delete");
JButton exportButton = new JButton("Export Data");
//Creates JTable
JTextField textBox = new JTextField(20);
table = new JTable(model);
JScrollPane scrollPane = new JScrollPane(table);
table.setFillsViewportHeight(true);
//Creates Menu Bar
JMenuBar menuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
JMenu helpMenu = new JMenu("Help");
menuBar.add(fileMenu);
menuBar.add(helpMenu);
JMenuItem openAction = new JMenuItem("Open");
JMenuItem exitAction = new JMenuItem("Exit");
JMenuItem exportAction = new JMenuItem("Export");
JMenuItem aboutAction = new JMenuItem("About");
fileMenu.add(openAction);
fileMenu.add(exportAction);
fileMenu.add(exitAction);
helpMenu.add(aboutAction);
//fileChooser.setDialogTitle("Choose a file");
//ActionListener
openAction.addActionListener(this);
exitAction.addActionListener(this);
aboutAction.addActionListener(this);
addButton.addActionListener(this);
//Action Events
//Adds Elements to Java Frame
viewer.setJMenuBar(menuBar);
viewer.add(search);
viewer.add(options);
viewer.add(textBox);
viewer.add(addButton);
viewer.add(deleteButton);
viewer.add(scrollPane);
viewer.add(exportButton);
viewer.setVisible(true);
}
public void addUser()
{
JButton OK = new JButton("OK");
JButton CANCEL = new JButton("CANCEL");
//JTextField
//Strings
JLabel firstName = new JLabel("First Name");
JLabel lastName = new JLabel("Last Name");
JLabel EMPLID = new JLabel("EMPLID");
JLabel GPA = new JLabel("GPA");
JLabel venusLogin = new JLabel("Venus Login");
//ActionListener
first.addActionListener(this);
last.addActionListener(this);
emplid.addActionListener(this);
gpa.addActionListener(this);
first.addKeyListener(this);
last.addKeyListener(this);
emplid.addKeyListener(this);
viewerAdd = new JFrame("Add User");
viewerAdd.setSize(300, 200);
viewerAdd.setDefaultCloseOperation(viewerAdd.HIDE_ON_CLOSE);
viewerAdd.setLayout(new GridLayout(6,2));
viewerAdd.setLocationRelativeTo(viewerAdd);
viewerAdd.add(firstName);
viewerAdd.add(first);
viewerAdd.add(lastName);
viewerAdd.add(last);
viewerAdd.add(EMPLID);
viewerAdd.add(emplid);
viewerAdd.add(GPA);
viewerAdd.add(gpa);
viewerAdd.add(venusLogin);
viewerAdd.add(venus);
viewerAdd.add(OK);
viewerAdd.add(CANCEL);
OK.addActionListener(this);
CANCEL.addActionListener(this);
venus.setEditable(false);
viewerAdd.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) throws NumberFormatException
{
switch(e.getActionCommand())
{
case "Exit":
System.exit(0);
break;
case "Open":
FileDialog fileChooser = new FileDialog(viewerAdd,"Select file",FileDialog.LOAD);
fileChooser.setVisible(true);
JFileChooser a = new JFileChooser(fileChooser.getFile());
File[] file;
file = fileChooser.getFiles();
if(fileChooser.getFile() != null)
{
try
{
BufferedReader br = new BufferedReader(new FileReader(file[0]));
String line;
while ((line = br.readLine()) != null)
{
StringTokenizer st = new StringTokenizer(line, "," +" ");
String f = st.nextToken();
String l = st.nextToken();
String em = st.nextToken();
String g = st.nextToken();
String v = st.nextToken();
model.addRow(new Object[]{rowCount++,f, l, em, g, v});
}
}
catch (FileNotFoundException ex)
{
System.out.println("o");
}
catch (IOException e1)
{
JOptionPane.showMessageDialog(fileChooser, "There was an IO Exception that was
caught. Error: "+ e1.getMessage(), null, JOptionPane.ERROR_MESSAGE);
e1.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null, "File Not Selected", null,
JOptionPane.ERROR_MESSAGE);
}
break;
case "About":
JOptionPane.showMessageDialog(viewer, "This is an App made by ");
break;
case "Add":
addUser();
break;
case "OK":
int userAction1 = JOptionPane.showConfirmDialog(null, "Are You Sure You Want To Insert
this Record?");
int number;
double number1;
boolean emp, ga = false;
if(userAction1 == JOptionPane.YES_OPTION)
{
String firstName = first.getText();
String lastName = last.getText();
String Emplid = emplid.getText();
String Gpa = gpa.getText();
if (firstName.length() < 2)
JOptionPane.showMessageDialog(null, "First Name must contain at least 2 characters",
null, JOptionPane.ERROR_MESSAGE);
else if (lastName.length() < 2)
JOptionPane.showMessageDialog(null, "Last Name must contain at least 2 characters",
null, JOptionPane.ERROR_MESSAGE);
else if (Emplid.length()!=8)
JOptionPane.showMessageDialog(null, "EMPLID must contain 8 numbers", null,
JOptionPane.ERROR_MESSAGE);
try
{
number = Integer.parseInt(Emplid);
try
{
number1 = Double.parseDouble(Gpa);
if(number1 < 0 || number1 > 4)
JOptionPane.showMessageDialog(null, "GPA must be between 0.0 - 4.0", null,
JOptionPane.ERROR_MESSAGE);
else
ga = true;
}
catch (Exception s)
{
JOptionPane.showMessageDialog(null, "GPA must be between 0.0 - 4.0", null,
JOptionPane.ERROR_MESSAGE);
}
}
catch (Exception s)
{
JOptionPane.showMessageDialog(null, "EMPLID must contain 8 numbers only", null,
JOptionPane.ERROR_MESSAGE);
}
if (ga == true)
{
model.addRow(new Object[]{rowCount++,firstName, lastName, Emplid, Gpa, Venus});
viewerAdd.setVisible(false);
first = new JTextField(20);
last = new JTextField(20);
emplid = new JTextField(20);
gpa = new JTextField(20);
venus = new JTextField(10);
}
}
break;
case "CANCEL":
viewerAdd.setVisible(false);
break;
}
}
@Override
public void keyTyped(KeyEvent e)
{
try
{
venus.setText(last.getText().substring(0,2)+first.getText().substring(0,2)+emplid.getText().sub
string(4,8));
}
catch(Exception s)
{
}
Venus = venus.getText();
}
@Override
public void keyPressed(KeyEvent e)
{
try
{
venus.setText(last.getText().substring(0,2)+first.getText().substring(0,2)+emplid.getText().sub
string(4,8));
}
catch(Exception s)
{
}
Venus = venus.getText();
}
@Override
public void keyReleased(KeyEvent e)
{
try
{
venus.setText(last.getText().substring(0,2)+first.getText().substring(0,2)+emplid.getText().sub
string(4,8));
}
catch(Exception s)
{
}
Venus = venus.getText();
}
}
Solution
step 1:Go to the Navigation Pane, expand JScrollPane option
step 2:In JSCROLLPne, right-click on JTable and Select Customize Code as shown below:
step 3:On the code customizer option, choose custom property in the second drop down
step 4: Insert the code written below ,before the last bracket);code is given below
step5:{public boolean isCellEditable(int row, int column){return false;}}
Ad

More Related Content

Similar to How do I make my JTable non editableimport java.awt.; import j.pdf (20)

I am getting a syntax error. I cant seem to find whats causing t.pdf
I am getting a syntax error. I cant seem to find whats causing t.pdfI am getting a syntax error. I cant seem to find whats causing t.pdf
I am getting a syntax error. I cant seem to find whats causing t.pdf
fashionfolionr
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
fathimaoptical
 
Main class --------------------------import java.awt.FlowLayout.pdf
Main class --------------------------import java.awt.FlowLayout.pdfMain class --------------------------import java.awt.FlowLayout.pdf
Main class --------------------------import java.awt.FlowLayout.pdf
anushkaent7
 
Implement threads and a GUI interface using advanced Java Swing clas.pdf
Implement threads and a GUI interface using advanced Java Swing clas.pdfImplement threads and a GUI interface using advanced Java Swing clas.pdf
Implement threads and a GUI interface using advanced Java Swing clas.pdf
amrishinda
 
Notepad
NotepadNotepad
Notepad
Apr Jns
 
You are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdfYou are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdf
JUSTSTYLISH3B2MOHALI
 
Java!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdfJava!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdf
arvindarora20042013
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
lupe ga
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
venkt12345
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.
Kuldeep Jain
 
Easy Button
Easy ButtonEasy Button
Easy Button
Adam Dale
 
Ejemplo radio
Ejemplo radioEjemplo radio
Ejemplo radio
lupe ga
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
whitneyleman54422
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
Ryunosuke SATO
 
import javaxswing import javaawtevent import javai.pdf
import javaxswing import javaawtevent import javai.pdfimport javaxswing import javaawtevent import javai.pdf
import javaxswing import javaawtevent import javai.pdf
ADITIEYEWEAR
 
Java Assignment Help
Java Assignment HelpJava Assignment Help
Java Assignment Help
Programming Assignments
 
Maze
MazeMaze
Maze
yito24
 
Soundreader.classpathSoundreader.project Soundre.docx
Soundreader.classpathSoundreader.project  Soundre.docxSoundreader.classpathSoundreader.project  Soundre.docx
Soundreader.classpathSoundreader.project Soundre.docx
whitneyleman54422
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdf
atulkapoor33
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
Ankit Rastogi
 
I am getting a syntax error. I cant seem to find whats causing t.pdf
I am getting a syntax error. I cant seem to find whats causing t.pdfI am getting a syntax error. I cant seem to find whats causing t.pdf
I am getting a syntax error. I cant seem to find whats causing t.pdf
fashionfolionr
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
fathimaoptical
 
Main class --------------------------import java.awt.FlowLayout.pdf
Main class --------------------------import java.awt.FlowLayout.pdfMain class --------------------------import java.awt.FlowLayout.pdf
Main class --------------------------import java.awt.FlowLayout.pdf
anushkaent7
 
Implement threads and a GUI interface using advanced Java Swing clas.pdf
Implement threads and a GUI interface using advanced Java Swing clas.pdfImplement threads and a GUI interface using advanced Java Swing clas.pdf
Implement threads and a GUI interface using advanced Java Swing clas.pdf
amrishinda
 
You are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdfYou are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdf
JUSTSTYLISH3B2MOHALI
 
Java!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdfJava!!!!!Create a program that authenticates username and password.pdf
Java!!!!!Create a program that authenticates username and password.pdf
arvindarora20042013
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
lupe ga
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
venkt12345
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.
Kuldeep Jain
 
Ejemplo radio
Ejemplo radioEjemplo radio
Ejemplo radio
lupe ga
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
whitneyleman54422
 
import javaxswing import javaawtevent import javai.pdf
import javaxswing import javaawtevent import javai.pdfimport javaxswing import javaawtevent import javai.pdf
import javaxswing import javaawtevent import javai.pdf
ADITIEYEWEAR
 
Soundreader.classpathSoundreader.project Soundre.docx
Soundreader.classpathSoundreader.project  Soundre.docxSoundreader.classpathSoundreader.project  Soundre.docx
Soundreader.classpathSoundreader.project Soundre.docx
whitneyleman54422
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdf
atulkapoor33
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
Ankit Rastogi
 

More from forwardcom41 (20)

Hello!Can someone help me to answer Task4 and Task7Complete T.pdf
Hello!Can someone help me to answer Task4 and Task7Complete T.pdfHello!Can someone help me to answer Task4 and Task7Complete T.pdf
Hello!Can someone help me to answer Task4 and Task7Complete T.pdf
forwardcom41
 
Hey I need help creating this code using Visual Studio (Basic) 2015.pdf
Hey I need help creating this code using Visual Studio (Basic) 2015.pdfHey I need help creating this code using Visual Studio (Basic) 2015.pdf
Hey I need help creating this code using Visual Studio (Basic) 2015.pdf
forwardcom41
 
Given technology today, would it be more feasible than in the pa.pdf
Given technology today, would it be more feasible than in the pa.pdfGiven technology today, would it be more feasible than in the pa.pdf
Given technology today, would it be more feasible than in the pa.pdf
forwardcom41
 
Explain the difference between a contaminated culture and a mix c.pdf
Explain the difference between a contaminated culture and a mix c.pdfExplain the difference between a contaminated culture and a mix c.pdf
Explain the difference between a contaminated culture and a mix c.pdf
forwardcom41
 
Explain in detail how OFDM helps mitigates multipath fading effects..pdf
Explain in detail how OFDM helps mitigates multipath fading effects..pdfExplain in detail how OFDM helps mitigates multipath fading effects..pdf
Explain in detail how OFDM helps mitigates multipath fading effects..pdf
forwardcom41
 
Complete a scientific inquiry research using three credible sources..pdf
Complete a scientific inquiry research using three credible sources..pdfComplete a scientific inquiry research using three credible sources..pdf
Complete a scientific inquiry research using three credible sources..pdf
forwardcom41
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
forwardcom41
 
Describe and illustrate the use of a bank reconciliation in controll.pdf
Describe and illustrate the use of a bank reconciliation in controll.pdfDescribe and illustrate the use of a bank reconciliation in controll.pdf
Describe and illustrate the use of a bank reconciliation in controll.pdf
forwardcom41
 
Why is it important for a trainer (trainers) to understand the commu.pdf
Why is it important for a trainer (trainers) to understand the commu.pdfWhy is it important for a trainer (trainers) to understand the commu.pdf
Why is it important for a trainer (trainers) to understand the commu.pdf
forwardcom41
 
What are the various portals an enterprise can use What is the func.pdf
What are the various portals an enterprise can use What is the func.pdfWhat are the various portals an enterprise can use What is the func.pdf
What are the various portals an enterprise can use What is the func.pdf
forwardcom41
 
What is the nature of thermal energy What is heat at the atomic lev.pdf
What is the nature of thermal energy What is heat at the atomic lev.pdfWhat is the nature of thermal energy What is heat at the atomic lev.pdf
What is the nature of thermal energy What is heat at the atomic lev.pdf
forwardcom41
 
w Hstory Bookmarks Window Help Apple Bing Google Taho0 NewaDetals MIN.pdf
w Hstory Bookmarks Window Help Apple Bing Google Taho0 NewaDetals MIN.pdfw Hstory Bookmarks Window Help Apple Bing Google Taho0 NewaDetals MIN.pdf
w Hstory Bookmarks Window Help Apple Bing Google Taho0 NewaDetals MIN.pdf
forwardcom41
 
Which of the following is not one of the ethical standards included .pdf
Which of the following is not one of the ethical standards included .pdfWhich of the following is not one of the ethical standards included .pdf
Which of the following is not one of the ethical standards included .pdf
forwardcom41
 
Using the guidance from ASC 855-10-55-1 and 855-10-55-2 Answer the f.pdf
Using the guidance from ASC 855-10-55-1 and 855-10-55-2 Answer the f.pdfUsing the guidance from ASC 855-10-55-1 and 855-10-55-2 Answer the f.pdf
Using the guidance from ASC 855-10-55-1 and 855-10-55-2 Answer the f.pdf
forwardcom41
 
why we need mixed methodology for researchSolutionMixed metho.pdf
why we need mixed methodology for researchSolutionMixed metho.pdfwhy we need mixed methodology for researchSolutionMixed metho.pdf
why we need mixed methodology for researchSolutionMixed metho.pdf
forwardcom41
 
What property doesnt apply to fluids Newtons second, cons of ene.pdf
What property doesnt apply to fluids Newtons second, cons of ene.pdfWhat property doesnt apply to fluids Newtons second, cons of ene.pdf
What property doesnt apply to fluids Newtons second, cons of ene.pdf
forwardcom41
 
What is the threat to culture by a read-only world, and how do t.pdf
What is the threat to culture by a read-only world, and how do t.pdfWhat is the threat to culture by a read-only world, and how do t.pdf
What is the threat to culture by a read-only world, and how do t.pdf
forwardcom41
 
What is one hypothesis to explain why there are more endemic bird sp.pdf
What is one hypothesis to explain why there are more endemic bird sp.pdfWhat is one hypothesis to explain why there are more endemic bird sp.pdf
What is one hypothesis to explain why there are more endemic bird sp.pdf
forwardcom41
 
What are the ethical tensions in advertisingWho are the responsib.pdf
What are the ethical tensions in advertisingWho are the responsib.pdfWhat are the ethical tensions in advertisingWho are the responsib.pdf
What are the ethical tensions in advertisingWho are the responsib.pdf
forwardcom41
 
Use the following information to answer the next Question. The graph.pdf
Use the following information to answer the next Question.  The graph.pdfUse the following information to answer the next Question.  The graph.pdf
Use the following information to answer the next Question. The graph.pdf
forwardcom41
 
Hello!Can someone help me to answer Task4 and Task7Complete T.pdf
Hello!Can someone help me to answer Task4 and Task7Complete T.pdfHello!Can someone help me to answer Task4 and Task7Complete T.pdf
Hello!Can someone help me to answer Task4 and Task7Complete T.pdf
forwardcom41
 
Hey I need help creating this code using Visual Studio (Basic) 2015.pdf
Hey I need help creating this code using Visual Studio (Basic) 2015.pdfHey I need help creating this code using Visual Studio (Basic) 2015.pdf
Hey I need help creating this code using Visual Studio (Basic) 2015.pdf
forwardcom41
 
Given technology today, would it be more feasible than in the pa.pdf
Given technology today, would it be more feasible than in the pa.pdfGiven technology today, would it be more feasible than in the pa.pdf
Given technology today, would it be more feasible than in the pa.pdf
forwardcom41
 
Explain the difference between a contaminated culture and a mix c.pdf
Explain the difference between a contaminated culture and a mix c.pdfExplain the difference between a contaminated culture and a mix c.pdf
Explain the difference between a contaminated culture and a mix c.pdf
forwardcom41
 
Explain in detail how OFDM helps mitigates multipath fading effects..pdf
Explain in detail how OFDM helps mitigates multipath fading effects..pdfExplain in detail how OFDM helps mitigates multipath fading effects..pdf
Explain in detail how OFDM helps mitigates multipath fading effects..pdf
forwardcom41
 
Complete a scientific inquiry research using three credible sources..pdf
Complete a scientific inquiry research using three credible sources..pdfComplete a scientific inquiry research using three credible sources..pdf
Complete a scientific inquiry research using three credible sources..pdf
forwardcom41
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
forwardcom41
 
Describe and illustrate the use of a bank reconciliation in controll.pdf
Describe and illustrate the use of a bank reconciliation in controll.pdfDescribe and illustrate the use of a bank reconciliation in controll.pdf
Describe and illustrate the use of a bank reconciliation in controll.pdf
forwardcom41
 
Why is it important for a trainer (trainers) to understand the commu.pdf
Why is it important for a trainer (trainers) to understand the commu.pdfWhy is it important for a trainer (trainers) to understand the commu.pdf
Why is it important for a trainer (trainers) to understand the commu.pdf
forwardcom41
 
What are the various portals an enterprise can use What is the func.pdf
What are the various portals an enterprise can use What is the func.pdfWhat are the various portals an enterprise can use What is the func.pdf
What are the various portals an enterprise can use What is the func.pdf
forwardcom41
 
What is the nature of thermal energy What is heat at the atomic lev.pdf
What is the nature of thermal energy What is heat at the atomic lev.pdfWhat is the nature of thermal energy What is heat at the atomic lev.pdf
What is the nature of thermal energy What is heat at the atomic lev.pdf
forwardcom41
 
w Hstory Bookmarks Window Help Apple Bing Google Taho0 NewaDetals MIN.pdf
w Hstory Bookmarks Window Help Apple Bing Google Taho0 NewaDetals MIN.pdfw Hstory Bookmarks Window Help Apple Bing Google Taho0 NewaDetals MIN.pdf
w Hstory Bookmarks Window Help Apple Bing Google Taho0 NewaDetals MIN.pdf
forwardcom41
 
Which of the following is not one of the ethical standards included .pdf
Which of the following is not one of the ethical standards included .pdfWhich of the following is not one of the ethical standards included .pdf
Which of the following is not one of the ethical standards included .pdf
forwardcom41
 
Using the guidance from ASC 855-10-55-1 and 855-10-55-2 Answer the f.pdf
Using the guidance from ASC 855-10-55-1 and 855-10-55-2 Answer the f.pdfUsing the guidance from ASC 855-10-55-1 and 855-10-55-2 Answer the f.pdf
Using the guidance from ASC 855-10-55-1 and 855-10-55-2 Answer the f.pdf
forwardcom41
 
why we need mixed methodology for researchSolutionMixed metho.pdf
why we need mixed methodology for researchSolutionMixed metho.pdfwhy we need mixed methodology for researchSolutionMixed metho.pdf
why we need mixed methodology for researchSolutionMixed metho.pdf
forwardcom41
 
What property doesnt apply to fluids Newtons second, cons of ene.pdf
What property doesnt apply to fluids Newtons second, cons of ene.pdfWhat property doesnt apply to fluids Newtons second, cons of ene.pdf
What property doesnt apply to fluids Newtons second, cons of ene.pdf
forwardcom41
 
What is the threat to culture by a read-only world, and how do t.pdf
What is the threat to culture by a read-only world, and how do t.pdfWhat is the threat to culture by a read-only world, and how do t.pdf
What is the threat to culture by a read-only world, and how do t.pdf
forwardcom41
 
What is one hypothesis to explain why there are more endemic bird sp.pdf
What is one hypothesis to explain why there are more endemic bird sp.pdfWhat is one hypothesis to explain why there are more endemic bird sp.pdf
What is one hypothesis to explain why there are more endemic bird sp.pdf
forwardcom41
 
What are the ethical tensions in advertisingWho are the responsib.pdf
What are the ethical tensions in advertisingWho are the responsib.pdfWhat are the ethical tensions in advertisingWho are the responsib.pdf
What are the ethical tensions in advertisingWho are the responsib.pdf
forwardcom41
 
Use the following information to answer the next Question. The graph.pdf
Use the following information to answer the next Question.  The graph.pdfUse the following information to answer the next Question.  The graph.pdf
Use the following information to answer the next Question. The graph.pdf
forwardcom41
 
Ad

Recently uploaded (20)

Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Cyber security COPA ITI MCQ Top Questions
Cyber security COPA ITI MCQ Top QuestionsCyber security COPA ITI MCQ Top Questions
Cyber security COPA ITI MCQ Top Questions
SONU HEETSON
 
"Heraldry Detective Project"- Coats of Arms and Mottos of "Ivanhoe" in Ivanho...
"Heraldry Detective Project"- Coats of Arms and Mottos of "Ivanhoe" in Ivanho..."Heraldry Detective Project"- Coats of Arms and Mottos of "Ivanhoe" in Ivanho...
"Heraldry Detective Project"- Coats of Arms and Mottos of "Ivanhoe" in Ivanho...
ruslana1975
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docxPeer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
19lburrell
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
Rebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter worldRebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter world
Ned Potter
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-14-2025 .pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-14-2025  .pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-14-2025  .pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-14-2025 .pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
How to Configure Extra Steps During Checkout in Odoo 18 Website
How to Configure Extra Steps During Checkout in Odoo 18 WebsiteHow to Configure Extra Steps During Checkout in Odoo 18 Website
How to Configure Extra Steps During Checkout in Odoo 18 Website
Celine George
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Cyber security COPA ITI MCQ Top Questions
Cyber security COPA ITI MCQ Top QuestionsCyber security COPA ITI MCQ Top Questions
Cyber security COPA ITI MCQ Top Questions
SONU HEETSON
 
"Heraldry Detective Project"- Coats of Arms and Mottos of "Ivanhoe" in Ivanho...
"Heraldry Detective Project"- Coats of Arms and Mottos of "Ivanhoe" in Ivanho..."Heraldry Detective Project"- Coats of Arms and Mottos of "Ivanhoe" in Ivanho...
"Heraldry Detective Project"- Coats of Arms and Mottos of "Ivanhoe" in Ivanho...
ruslana1975
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docxPeer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
Peer Assessment_ Unit 2 Skills Development for Live Performance - for Libby.docx
19lburrell
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
Rebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter worldRebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter world
Ned Potter
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
How to Configure Extra Steps During Checkout in Odoo 18 Website
How to Configure Extra Steps During Checkout in Odoo 18 WebsiteHow to Configure Extra Steps During Checkout in Odoo 18 Website
How to Configure Extra Steps During Checkout in Odoo 18 Website
Celine George
 
Ad

How do I make my JTable non editableimport java.awt.; import j.pdf

  • 1. How do I make my JTable non editable? import java.awt.*; import javax.swing.table.*; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableModel; import java.awt.event.*; import java.io.*; import javax.swing.*; import java.nio.*; import java.nio.charset.Charset; import java.nio.file.*; import java.awt.Desktop; import java.io.File; import java.io.IOException; import java.util.Scanner; import java.util.StringTokenizer; public class SwingDemo implements ActionListener, KeyListener { JLabel search, output; JFrame viewer; JTable table = new JTable(new DefaultTableModel(null, new Object []{"Row ID", "First Name", "Last Name", "EMPLID", "GPA", "Venus Login"})); JFrame viewerAdd; DefaultTableModel model = (DefaultTableModel) table.getModel(); JTextField first = new JTextField(20); JTextField last = new JTextField(20); JTextField emplid = new JTextField(20); JTextField gpa = new JTextField(20); JTextField venus = new JTextField(10); String Venus; public static int rowCount = 1; public final static int LOAD = 0;
  • 2. public final static int SAVE = 1; public SwingDemo() { //Creates Java Frame viewer = new JFrame("Final Project"); viewer.setSize(570, 650); viewer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); viewer.setLayout(new FlowLayout()); viewer.setLocationRelativeTo(viewer); //Creates Drop Down Menu String[] option = { "Row ID", "First Name", "Last Name", "EMPLID", "GPA", "Venus Login" }; JComboBox options = new JComboBox(option); options.setSelectedIndex(0); //Creates Button and Labels search = new JLabel("Search by: "); JButton addButton = new JButton("Add"); JButton deleteButton = new JButton("Delete"); JButton exportButton = new JButton("Export Data"); //Creates JTable JTextField textBox = new JTextField(20); table = new JTable(model); JScrollPane scrollPane = new JScrollPane(table); table.setFillsViewportHeight(true); //Creates Menu Bar JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); JMenu helpMenu = new JMenu("Help"); menuBar.add(fileMenu); menuBar.add(helpMenu);
  • 3. JMenuItem openAction = new JMenuItem("Open"); JMenuItem exitAction = new JMenuItem("Exit"); JMenuItem exportAction = new JMenuItem("Export"); JMenuItem aboutAction = new JMenuItem("About"); fileMenu.add(openAction); fileMenu.add(exportAction); fileMenu.add(exitAction); helpMenu.add(aboutAction); //fileChooser.setDialogTitle("Choose a file"); //ActionListener openAction.addActionListener(this); exitAction.addActionListener(this); aboutAction.addActionListener(this); addButton.addActionListener(this); //Action Events //Adds Elements to Java Frame viewer.setJMenuBar(menuBar); viewer.add(search); viewer.add(options); viewer.add(textBox); viewer.add(addButton); viewer.add(deleteButton); viewer.add(scrollPane); viewer.add(exportButton); viewer.setVisible(true); } public void addUser() { JButton OK = new JButton("OK"); JButton CANCEL = new JButton("CANCEL"); //JTextField
  • 4. //Strings JLabel firstName = new JLabel("First Name"); JLabel lastName = new JLabel("Last Name"); JLabel EMPLID = new JLabel("EMPLID"); JLabel GPA = new JLabel("GPA"); JLabel venusLogin = new JLabel("Venus Login"); //ActionListener first.addActionListener(this); last.addActionListener(this); emplid.addActionListener(this); gpa.addActionListener(this); first.addKeyListener(this); last.addKeyListener(this); emplid.addKeyListener(this); viewerAdd = new JFrame("Add User"); viewerAdd.setSize(300, 200); viewerAdd.setDefaultCloseOperation(viewerAdd.HIDE_ON_CLOSE); viewerAdd.setLayout(new GridLayout(6,2)); viewerAdd.setLocationRelativeTo(viewerAdd); viewerAdd.add(firstName); viewerAdd.add(first); viewerAdd.add(lastName); viewerAdd.add(last); viewerAdd.add(EMPLID); viewerAdd.add(emplid); viewerAdd.add(GPA); viewerAdd.add(gpa); viewerAdd.add(venusLogin); viewerAdd.add(venus); viewerAdd.add(OK); viewerAdd.add(CANCEL); OK.addActionListener(this); CANCEL.addActionListener(this);
  • 5. venus.setEditable(false); viewerAdd.setVisible(true); } @Override public void actionPerformed(ActionEvent e) throws NumberFormatException { switch(e.getActionCommand()) { case "Exit": System.exit(0); break; case "Open": FileDialog fileChooser = new FileDialog(viewerAdd,"Select file",FileDialog.LOAD); fileChooser.setVisible(true); JFileChooser a = new JFileChooser(fileChooser.getFile()); File[] file; file = fileChooser.getFiles(); if(fileChooser.getFile() != null) { try { BufferedReader br = new BufferedReader(new FileReader(file[0])); String line; while ((line = br.readLine()) != null) { StringTokenizer st = new StringTokenizer(line, "," +" "); String f = st.nextToken(); String l = st.nextToken(); String em = st.nextToken();
  • 6. String g = st.nextToken(); String v = st.nextToken(); model.addRow(new Object[]{rowCount++,f, l, em, g, v}); } } catch (FileNotFoundException ex) { System.out.println("o"); } catch (IOException e1) { JOptionPane.showMessageDialog(fileChooser, "There was an IO Exception that was caught. Error: "+ e1.getMessage(), null, JOptionPane.ERROR_MESSAGE); e1.printStackTrace(); } } else { JOptionPane.showMessageDialog(null, "File Not Selected", null, JOptionPane.ERROR_MESSAGE); } break; case "About": JOptionPane.showMessageDialog(viewer, "This is an App made by "); break; case "Add": addUser(); break; case "OK": int userAction1 = JOptionPane.showConfirmDialog(null, "Are You Sure You Want To Insert this Record?"); int number; double number1;
  • 7. boolean emp, ga = false; if(userAction1 == JOptionPane.YES_OPTION) { String firstName = first.getText(); String lastName = last.getText(); String Emplid = emplid.getText(); String Gpa = gpa.getText(); if (firstName.length() < 2) JOptionPane.showMessageDialog(null, "First Name must contain at least 2 characters", null, JOptionPane.ERROR_MESSAGE); else if (lastName.length() < 2) JOptionPane.showMessageDialog(null, "Last Name must contain at least 2 characters", null, JOptionPane.ERROR_MESSAGE); else if (Emplid.length()!=8) JOptionPane.showMessageDialog(null, "EMPLID must contain 8 numbers", null, JOptionPane.ERROR_MESSAGE); try { number = Integer.parseInt(Emplid); try { number1 = Double.parseDouble(Gpa); if(number1 < 0 || number1 > 4) JOptionPane.showMessageDialog(null, "GPA must be between 0.0 - 4.0", null, JOptionPane.ERROR_MESSAGE); else ga = true; } catch (Exception s) { JOptionPane.showMessageDialog(null, "GPA must be between 0.0 - 4.0", null, JOptionPane.ERROR_MESSAGE); } }
  • 8. catch (Exception s) { JOptionPane.showMessageDialog(null, "EMPLID must contain 8 numbers only", null, JOptionPane.ERROR_MESSAGE); } if (ga == true) { model.addRow(new Object[]{rowCount++,firstName, lastName, Emplid, Gpa, Venus}); viewerAdd.setVisible(false); first = new JTextField(20); last = new JTextField(20); emplid = new JTextField(20); gpa = new JTextField(20); venus = new JTextField(10); } } break; case "CANCEL": viewerAdd.setVisible(false); break; } } @Override public void keyTyped(KeyEvent e) { try { venus.setText(last.getText().substring(0,2)+first.getText().substring(0,2)+emplid.getText().sub string(4,8)); }
  • 9. catch(Exception s) { } Venus = venus.getText(); } @Override public void keyPressed(KeyEvent e) { try { venus.setText(last.getText().substring(0,2)+first.getText().substring(0,2)+emplid.getText().sub string(4,8)); } catch(Exception s) { } Venus = venus.getText(); } @Override public void keyReleased(KeyEvent e) { try { venus.setText(last.getText().substring(0,2)+first.getText().substring(0,2)+emplid.getText().sub string(4,8)); } catch(Exception s) { } Venus = venus.getText();
  • 10. } } Solution step 1:Go to the Navigation Pane, expand JScrollPane option step 2:In JSCROLLPne, right-click on JTable and Select Customize Code as shown below: step 3:On the code customizer option, choose custom property in the second drop down step 4: Insert the code written below ,before the last bracket);code is given below step5:{public boolean isCellEditable(int row, int column){return false;}}
  翻译: