Komisches Problem

Status
Nicht offen für weitere Antworten.

Siegfried

Mitglied
Hallo.
Ich hab eine Anwendung gemacht und der Kompiler sagt:

Project settings saved
Building "WordGame-Surprise"
C:\Programme\Java\WTK\apps\WordGame-Surprise\src\WordGameSurprise.java:4: class WordGame is public, should be declared in a file named WordGame.java
public class WordGame extends MIDlet implements CommandListener
^
1 error
com.sun.kvem.ktools.ExecutionException
Build failed

Warum geht das nicht?
Das ist der verwendete Code :
Code:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class WordGame extends MIDlet implements CommandListener
{
   Display display;
   
   Command menu1 = new Command("A",Command.ITEM,1);
   Command menu2 = new Command("B",Command.ITEM,1);
   Command menu3 = new Command("C",Command.ITEM,1);
   Command menu4 = new Command("D",Command.ITEM,1);
   Command menu5 = new Command("E",Command.ITEM,1);
   Command menu6 = new Command("F",Command.ITEM,1);
   Command menu7 = new Command("G",Command.ITEM,1);
   Command menu8 = new Command("H",Command.ITEM,1);
   Command menuE = new Command("Schließen",Command.EXIT,1);

   Form Window = new Form("WordGame-Surprise");

   public WordGame()
   {
      Window.append("Text...");
      Window.addCommand(menu1); 
      Window.addCommand(menu2); 
      Window.addCommand(menu3); 
      Window.addCommand(menu4); 
      Window.addCommand(menu5); 
      Window.addCommand(menu6); 
      Window.addCommand(menu7); 
      Window.addCommand(menu8); 
      Window.addCommand(menuE);
      Window.setCommandListener(this);
   }
   protected void startApp()
   throws MIDletStateChangeException
   {
       display=Display.getDisplay(this);
       display.setCurrent(Window);   
   }

   protected void pauseApp()
   {
   }

   protected void destroyApp(boolean unconditional)
   throws MIDletStateChangeException
   {
   }

   public void commandAction(Command C, Displayable da)
   {
      if      (C==menuE) notifyDestroyed();
      else if (C==menu1) Window.append("A");
      else if (C==menu2) Window.append("B");  
      else if (C==menu3) Window.append("C");
      else if (C==menu4) Window.append("D");
      else if (C==menu5) Window.append("E");
      else if (C==menu6) Window.append("F");
      else if (C==menu7) Window.append("G");
      else if (C==menu8) Window.append("H");
   }
}

Weis vieleicht jemand eine Antwort?
Danke im Voraus.
Gruß, Siegfried :D.
 

MiMij

Bekanntes Mitglied
Hendrik hat es schon angedeutet:

Dateiname: WordGameSurprise.java
innerhalb der Datei steht dann aber: WordGame

So nun sollte dir was auffallen ^^
 
G

Guest

Gast
Ahso^^ THX.
Dachte ich kann das belibig bennenen xD.
Danke.
Gruß, Siegfried :D.
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
L Android komisches Bitmap-Größe-Problem Android & Cross-Platform Mobile Apps 8
W Prüfen, ob App auf Gerät installiert ist Problem S10 Android & Cross-Platform Mobile Apps 11
W In App Purchase Problem? Android & Cross-Platform Mobile Apps 36
W Problem mit Android Studio Android & Cross-Platform Mobile Apps 0
T Android R.string.test+i Problem Android & Cross-Platform Mobile Apps 2
K Android to Pi | Websocket Problem Android & Cross-Platform Mobile Apps 3
N Intent und finish() Problem Android & Cross-Platform Mobile Apps 5
B Android App Programmierung Einsteiger Problem Android & Cross-Platform Mobile Apps 4
emeraldo Android Problem mit Bottomnavmenu Android & Cross-Platform Mobile Apps 10
I Das Problem mit der Tastatur... android:windowSoftInputMode="adjustPan" Android & Cross-Platform Mobile Apps 1
M Android App → Problem mit dem Speichern von einem Bitmap–Objekt. Android & Cross-Platform Mobile Apps 1
A Android Android Studio Emulator Problem Android & Cross-Platform Mobile Apps 1
S Android Studio Bluetooth App Problem Android & Cross-Platform Mobile Apps 6
J TicTacToe Problem bei kontrolle Android & Cross-Platform Mobile Apps 7
J Button array ID Problem Android & Cross-Platform Mobile Apps 2
M Problem bei Werteübergabe, MSQL verbindung Android & Cross-Platform Mobile Apps 3
S Android Problem mit Android Virtual Device erstellung. Android & Cross-Platform Mobile Apps 2
Anfänger2011 Text to Speech Problem Android & Cross-Platform Mobile Apps 1
S Android Android java onclick listener Problem Android & Cross-Platform Mobile Apps 9
A Android Problem mit ListView und OnItemClickListener.. Android & Cross-Platform Mobile Apps 10
K Problem mit arraylist und button Android & Cross-Platform Mobile Apps 16
R W-Lan Problem über Sockets Android & Cross-Platform Mobile Apps 1
P ViewPager Problem Android & Cross-Platform Mobile Apps 1
A Android Problem mit Video von Youtube abspielen Android & Cross-Platform Mobile Apps 4
A Android Problem mit Zurücktaste und ausgabe der Aktuellen Seite Android & Cross-Platform Mobile Apps 6
B Android Problem mit Soundwiedergabe Android & Cross-Platform Mobile Apps 2
T Android Android Sensor: Java Problem Android & Cross-Platform Mobile Apps 1
G Problem beim Rendern von 3D-Objekt Android & Cross-Platform Mobile Apps 0
L Android Gyroscope Sensor Problem Android & Cross-Platform Mobile Apps 2
S Android GPS Problem Android & Cross-Platform Mobile Apps 24
J Eclipse Emulator Problem Android & Cross-Platform Mobile Apps 1
J Eclipse Emulator Problem Android & Cross-Platform Mobile Apps 0
B Android Problem mit Rückgabewert Android & Cross-Platform Mobile Apps 13
D Android Layout Problem Android & Cross-Platform Mobile Apps 2
R Problem mit View in ScrollView Android & Cross-Platform Mobile Apps 6
R Eclipse + AndroidSDK - Problem mit Referenzen Android & Cross-Platform Mobile Apps 6
M Problem mit setOnClickListener Android & Cross-Platform Mobile Apps 4
DaniSahne96 Problem beim Appdebuggen auf Smartphone Android & Cross-Platform Mobile Apps 3
P Android Problem beim Widget - Denkfehler ? Android & Cross-Platform Mobile Apps 2
M GCM IntentService Problem Android & Cross-Platform Mobile Apps 3
D Android Gallery Problem Android & Cross-Platform Mobile Apps 5
P Problem mit Cell id Android & Cross-Platform Mobile Apps 6
L Android Problem mit "spinner" Android & Cross-Platform Mobile Apps 10
D Android problem mit geschwindigkeitsberechnung app Android & Cross-Platform Mobile Apps 2
E Android Problem mit Contact Provider Android & Cross-Platform Mobile Apps 1
H Android Problem mit ListActivity Android & Cross-Platform Mobile Apps 3
S Android Layout Problem mit fill_parent Android & Cross-Platform Mobile Apps 5
F Android ExpandableList, SimpleCursorTreeAdapter, Cursor Problem Android & Cross-Platform Mobile Apps 2
A Android Problem mit Long.getLong() bzw. Integer.getInteger() Android & Cross-Platform Mobile Apps 2
A Problem mit HTTP- Verbindung Android & Cross-Platform Mobile Apps 4
V [Java] und [JavaME] ClientServer StreamConnection . Problem beim lesen / schreiben Android & Cross-Platform Mobile Apps 2
F Eclipse JAD File erzeugen -- Problem Android & Cross-Platform Mobile Apps 10
R Ein Problem beim ausführen von folgendem Quelltext Android & Cross-Platform Mobile Apps 11
M Problem mit dem Auslesen von System Properties Android & Cross-Platform Mobile Apps 7
P wtk problem Android & Cross-Platform Mobile Apps 3
G Math exp() Problem Android & Cross-Platform Mobile Apps 4
G S40 Problem Android & Cross-Platform Mobile Apps 8
A Problem beim Subtrahieren eines Double von einem Double Android & Cross-Platform Mobile Apps 5
C Problem Device/Emulator wird nicht erkannt Android & Cross-Platform Mobile Apps 3
S Image Problem Android & Cross-Platform Mobile Apps 11
M Problem mit den Softkeys Android & Cross-Platform Mobile Apps 4
G J2ME jar-problem Android & Cross-Platform Mobile Apps 10
F Problem beim Erstellen der Jar File Android & Cross-Platform Mobile Apps 4
A Problem: Canvas-Grösse Motorola RAZR v3r Android & Cross-Platform Mobile Apps 8
S Problem mit Einbindung einer externer Bibliothek Android & Cross-Platform Mobile Apps 2
G Random - Problem Android & Cross-Platform Mobile Apps 5
E problem mit den resourcen Android & Cross-Platform Mobile Apps 2
O Problem mit Datagramconnection Android & Cross-Platform Mobile Apps 2
P Problem mit der Uhrzeit Android & Cross-Platform Mobile Apps 2
S Problem auf dem Handy Android & Cross-Platform Mobile Apps 3

Ähnliche Java Themen

Neue Themen


Oben