• Post Reply Bookmark Topic Watch Topic
  • New Topic

Writing a GUI program  RSS feed

 
Jim Harvey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Can someone pls assist me in writing this GUI program. I'm attempting to write a GUI program to convert all letters in a string to uppercase letters. For example harvey808 would be converted to HARVEY808.

class Uppercase {
public static void main(String[] args)
{
String s = "harvey808";
String s2 = s.toUpperCase();
System.out.println(s2);
}
}

Thank you very much.

Best,
jrh
[ June 08, 2007: Message edited by: Jim Harvey ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

What do you mean by "input a GUI"? Do you want to add a GUI to this program? if so, what should it do? Are you familiar with the AWT or Swing GUI toolkits?
 
Jim Harvey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All one has to do is follow directions.....

* Description: This is a GUI program to convert all letters in a string to
*uppercase letters.
*
*/
public class
{
/**
* This will create the UppercaseConverter dialog
* @param args
*/
public static void main( String[] args )
{
new UppercaseConverter();
}

}
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


use new UpperCaseConverter().toUCase( "myString" );
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> All one has to do is follow directions.....

well, the directions are for you.

if you have a 'specific problem' about any of the directions,
we'll be only too happy to help.

to start you off, the gui shouldn't be doing any of the converting.
The gui's job is to display the data (input or output), and, most likely,
will have a button to convert the display. this button will call on your
current conversion method (totally separate of the gui), then redisplay the result
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use a method of JOption pane to get the String to be converted and use another call to another method of JOptionPane to display the results.

Kaydell
[ July 08, 2007: Message edited by: Kaydell Leavitt ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!