Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 1st, 2004, 11:55 AM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting focus on a JTextField when an applet runs

Hey.

I have been having trouble trying to set focus onto a jtextfield when my applet runs. I have tried:

textfield.requestFocus();
textfield.grabFocus();
etc.

How do I set the focus as soon as the applet runs? I have searched the net for ages and nobody seems to have an answer for me.

Thanks :)

Chris
 
Old January 1st, 2004, 05:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Set it in the applet's init() method.

Cheers

Martyn





Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Query Focus. eusanpe Access VBA 4 June 4th, 2008 10:20 AM
setting codebase for applet inside jsp file picky Java Basics 0 December 12th, 2006 08:12 AM
Setting the Focus BSkelding ASP.NET 1.0 and 1.1 Professional 1 May 12th, 2005 01:40 PM
Focus Problem with JTextField+InputVerifier mcapote Java GUI 0 July 10th, 2003 10:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.