Solved

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

Posted on 2006-06-16
3
305 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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
spring jars download 1 35
difference between sorce folder and folder in eclipise 3 28
add projects t working set in maven 2 16
learn programming 8 30
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…
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 …
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

791 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