File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in Sun One Studio Mobile Edition

 
pallavi utukuri
Ranch Hand
Posts: 182
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Bhopal Singh
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic