Can you create a column in a JTable that will use checkboxes for the editor that doesn't necessarily have values of "true" and "false." For instance, could checkboxes be used to indicate "male" vs. "female" or "Automatic" vs. "Manual?" If so, how does one programatically tell Java which option indicates a checkmark and which indicates a blank?
[ ] Automatic Transmission
Value of the checkbox checked would be "Automatic". Value of the checkbox unchecked would be "Manual".
That's possible indeed.
You have to write your own TableCellEditor for that column.
Creating a Custom Table Cell Editor in a JTable Component: http://www.exampledepot.com/egs/javax.swing.table/CustEdit.html
Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all. Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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…
Viewers will learn about the different types of variables in Java and how to declare them.
Decide the type of variable desired:
Put the keyword corresponding to the type of variable in front of the variable name:
Use the equal sign to assign a v…