?
Solved

Getting started: JTable data validation

Posted on 2001-06-21
3
Medium Priority
?
395 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

800 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