• 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

Error in Sun One Studio Mobile Edition

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am using Sun one studio for ME. To my surprise the follwing code is giving error.


StringTokenizer st=new StringTokenizer("buf","%");

i have imported java.util

still its gives the error saying
cannot resolve symbol
symbol : class StringTokenizer
StringTokenizer st=new StringTokenizer("buf","%");

i am totally failing to understand y
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe if you provide more information about the IDE/Editor you are using and the mode of compiling the source, it would help other to answer your query.

~Bhopal
 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using sun one studio 4 update 4 mobile edition. The following simple example quotes the problem:


import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.*;

public class HelloMIDlet extends MIDlet implements CommandListener {

private Command exitCommand; // The exit command
private Display display; // The display for this MIDlet

public HelloMIDlet() {
display = Display.getDisplay(this);
exitCommand = new Command("Exit", Command.SCREEN, 2);
}

public void startApp() {
StringTokenizer st=new StringTokenizer("buf","%");

TextBox t = new TextBox("Hello MIDlet", "Test string", 256, 0);

t.addCommand(exitCommand);
t.setCommandListener(this);

display.setCurrent(t);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}

public void commandAction(Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
}
}

}

This is the output:

HelloMIDlet.java [17:7] cannot resolve symbol
symbol : class StringTokenizer
location: class HelloMIDlet
StringTokenizer st=new StringTokenizer("buf","%");
HelloMIDlet.java [17:30] cannot resolve symbol
symbol : class StringTokenizer
location: class HelloMIDlet
StringTokenizer st=new StringTokenizer("buf","%");
2 errors
Errors compiling HelloMIDlet.
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic