Solved

"Disabled" input when used as a table's header component

Posted on 2006-06-16
3
276 Views
Last Modified: 2010-03-31
I want to change my JTable and add above each column header label a TextField / Combo that will be used for filtering.

I started doing so by implementing a TableCellRenderer and in the
getTableCellRendererComponent I am returning a panel with two rows, one for the Input and one for the Label.

It looks good but I could not focus on that input (not with the mouse and not with the keyboard) it's like the input is disabled.
I thought of adding a MouseListener to the input and activate event my selt but they did not work.

How can I do this?
0
Comment
Question by:ElishaMoshe
  • 2
3 Comments
 
LVL 26

Expert Comment

by:ksivananth
ID: 16923150
I don't think table header is editable and so you can't set a cell editor for that. You may try below,

1. When you want to edit the text field on the table header, just show a editable text field just on top of the header field( use windo as container? ).
2. When the user type text and press enter, get the text from the editable TF and hide it and then set the text to the header text fields.
0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 16924180
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 16924270
Great work!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
changeXy challenge 13 57
word0 challenge 4 52
Python Assistance 7 31
JDeveloper 12c for 32 bit 4 34
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
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.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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:

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now