• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Writing a GUI program

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
}

}
 
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


use new UpperCaseConverter().toUCase( "myString" );
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 694
Mac OS X Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic