Solved

Getting started: JTable data validation

Posted on 2001-06-21
3
382 Views
Last Modified: 2010-05-18

I have to write a set of methods which validate the data entered into a JTable.

My starting point is a method which loops through the cells of a row and checks to ensure that:
1. Each cell is not empty, and
2. Each cell does not contains only spaces.

(From there I would like to highlight the offending cell(s) and show a dialog box -- a separate matter)

I have been unable to find examples of similar validation code, either in my many Java books, or on the web.

Please let me know if you know of ANY publicly available table validation code examples, or if you are willing to share any examples of your own.

Many thanks in advance.

0
Comment
Question by:pkl_javaq
3 Comments
 
LVL 1

Expert Comment

by:kuro
ID: 6217483
Use below 3 methods in TableModel which is retuend by JTable.dataModel() to iterate all values in table.
  getColumnCount()
  getRowCount()
  getValueAt(int, int)
0
 
LVL 5

Expert Comment

by:vemul
ID: 7621026
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- To be PAQ'ed and points refunded
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 7643109
PAQ'ed and points removed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
table example 4 32
spring jars download 1 36
How to determine if a string is a valid SHA value 7 38
ejb entity bean example issue 2 18
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question