🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: jTabbedPane focus problem

#716
From: Arthur Ore
Date: Mon, 03 Jan 2005 20:41
40 lines
2089 bytes
Hi John,

I'm no expert on JTabbedPanes, but if I've understood what you are saying, 
I've just knocked up a quick bit of code and calling this.validate() or 
this.getContentPane().validate() seems to fix the problem you are describing 
depending on whether you are using a frame or an applet.

Hence my code reads something like :-

 void jTabbedPane1_mouseClicked(MouseEvent e)
  {
    if (jTabbedPane1.getSelectedIndex()==2)
    {
      this.getContentPane().validate();
      jTextField3.requestFocus();
    }

  }

Arth


"John T. Dow" <john@johntdow.com> wrote in message 
news:41D99FA3.7060700@johntdow.com...
> Further information on what I just posted.
>
> The component on the panel that is supposed to get focus does get focus, 
> but then loses it.
>
> So now the question is, where did the focus go?
>
> Also, to clarify, the component to get focus doesn't need to be the top 
> one on the panel. My earlier post may have been misleading on this point. 
> In the focusGained event for the panel, I'm specifying exactly which 
> component is to get focus.
>
> Thanks
>
> John
> 
Technical Details
Message-ID: <41d9ade3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41D99FA3.7060700@johntdow.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,a0ad10712e673590
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Arthur Ore" <nospamthx_arthur@nospamthx_arthurore.freeserve.co.uk>
Newsgroups: borland.public.jbuilder.java.swing
References: <41D99FA3.7060700@johntdow.com>
Subject: Re: jTabbedPane focus problem
Date: Mon, 3 Jan 2005 20:41:12 -0000
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
NNTP-Posting-Host: 82.69.65.131
Message-ID: <41d9ade3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1104784867 82.69.65.131 (3 Jan 2005 12:41:07 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail