🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #714

jTabbedPane focus problem

#714
From: John T. Dow
Date: Mon, 03 Jan 2005 19:31
24 lines
1869 bytes
When a particular tab is selected, either with the mouse or 
programmatically, I want focus to go to the top component on the 
selected panel. So far I can't make this happen. I've googled and have 
come up with possible solutions but no success yet.

The following almost works.

I added code to the jTabbedPane's stateChanged event to request focus 
for the appropriate jPanel that will be shown for that tab.

That panel's focusGained event is successfully triggered.

In the panel's focusGained event I added code to request focus for the 
component on the panel, but that does not work.

Someone suggested that the component may not be visible, so do 
setVisible(true) for it. That doesn't help.

I've also tried the componentShown event instead of focusGained for the 
panel, but no good.

Thanks

John
Technical Details
Message-ID: <41D99DA0.6040301@johntdow.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!news.netcologne.de!newsfeed-fusi.netcologne.de!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,a0ad10712e673590,start
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
Message-ID: <41D99DA0.6040301@johntdow.com>
Date: Mon, 03 Jan 2005 14:31:44 -0500
From: "John T. Dow" <john@johntdow.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: jTabbedPane focus problem
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 151.201.238.171
X-Trace: newsgroups.borland.com 1104780702 151.201.238.171 (3 Jan 2005 11:31:42 -0800)
Lines: 25
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!news.netcologne.de!newsfeed-fusi.netcologne.de!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail