Solved

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

Posted on 2006-06-16
3
313 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
[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
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

732 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