Solved

Getting started: JTable data validation

Posted on 2001-06-21
3
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

705 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