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 March 22nd, 2004, 04:44 PM
syu syu is offline
Registered User
 
Join Date: Dec 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Blank String in JRadioButton Constructor

Hi all,

I created a JRadioButton something like this:

String strUser = "UserName";
JRadioButton jrb = new JRadioButton("Hello" + " "+strUser);

However, the GUI doesn't display the blank string between two phrases. I also tried the following but none of them work.

JRadioButton jrb = new JRadioButton("Hello" + "\t"+strUser);

JRadioButton jrb = new JRadioButton("Hello "+strUser);

Does any one have any idea what's wrong with it?

Thank you in advance



 
Old March 25th, 2004, 07:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your first example works fine for me so I'm not sure why it doesn't for you. As an altenrative method you could always use setText(), but by doing this you aren't actually resolving your pronblem. Post all of your code and I'll have a look.

Cheers

Martyn





Similar Threads
Thread Thread Starter Forum Replies Last Post
Constructor nayeem69 .NET Framework 2.0 1 July 17th, 2007 12:33 AM
Constructor ramess C++ Programming 1 March 18th, 2006 07:23 PM
constructor in servlets bondalapati98 Servlets 5 January 16th, 2006 12:27 AM
Problem with a constructor Mishkina General .NET 0 September 23rd, 2005 08:26 AM
VB constructor snowbelly VB How-To 2 August 18th, 2004 04:42 AM





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