Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java Micro Edition
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Java Micro Edition
Something's wrong with my code
Lawrence Buensalida
Ranch Hand
Posts: 38
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I keep receiving
cannot resolve symbol
symbol: Constructor Form ()
location: class javax.microedition.lcdui.Form;
{
^
1 error
here's my code...
import javax.microedition.lcdui.*;
public class NewGame extends Form implements CommandListener
{
private WordMasterMind midlet;
private Command exitCommand = new Command("Exit", Command.EXIT,1);
private Command okCommand = new Command("Ok", Command.SCREEN, 1);
private MainMenuScreen mainMenuScreen;
Display display;
public NewGame()
{
TextBox greetings = new TextBox("Greetings", "Good morning", 15, 0);
display.setCurrent(greetings);
}
public void commandAction(Command c, Displayable s)
{
if(c==exitCommand)
{
midlet.mainMenuScreenShow(null);
return;
}
}
}
can you please tell me what's wrong with my code and what I'm to do about it. Thank you very much.
Punit Raizada
Ranch Hand
Posts: 156
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I dont think the javax.microedition.lcdui.Form class has a no argument constructor.
The only constructors exposed are
Form(
String
title);
Form(String title, Item[] items);
Regards,
SCJP 1.4
Everything that can go wrong will go wrong
-Murphy
Lawrence Buensalida
Ranch Hand
Posts: 38
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks Punit, but, why's that? Why am I receiving that error?
Svend Rost
Ranch Hand
Posts: 904
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You might not construction the object correctly..
Im not sure if this will work, but try to insert the following statement
as the first line in your NewGame constructor:
super("My new game");
and see what'll happen.
/Svend Rost
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
unable to create form.
Referencing a method form another class?
Error in Sun One Studio Mobile Edition
Why won't my BACK BUTTON work?
easy fundamental oop problem
More...