Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problems With This Code

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble compiling this code I do not seems like I got some errors.




 
Ranch Hand
Posts: 10192
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What hint does the compiler give you? I hope that line number 75 is commented out properly.
 
Brian Bykenhaal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a run down of all my problems thing is I can't seem to change the code correctly. This class was for when I was running my test on my board I need it in order to run my project. Thing is I do not need anything but the TicTacToe enabled. As you might know I have other classes and I am want to have it work with the other classes. So I need help with my int,int,ActionListener as you can see. Seems that I may of set up may code the wrong way not knowing it would have trouble compiling "Big Mistake"

So here you can see I use a this to make a new board but I am getting errors when compiling. My actual and formal argument lists differ in length and I need to fix that so I can compile.
Board TicTacToe = new Board(rows,cols);





 
Marshal
Posts: 69779
277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which package is the Board class in? Has it been compiled successfully?
 
Brian Bykenhaal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I got some issues still with my main and my cell classes. I rewrote the code and I think I fixed that errors. Now I have the following errors. My code Runs with the IDE but will not compile so I have to fix the following issues.

error: class TictacToeGUIGame is public, should be declared in a file named TictacToeGUIGame.java
public class TictacToeGUIGame extends JFrame {
1 error
The following error occurred while executing this line:
Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read and try to understand what the error messages mean. This tells you quite clearly what's wrong:

error: class TictacToeGUIGame is public, should be declared in a file named TictacToeGUIGame.java

What do you think the compiler is telling you here, and how do you think you could solve the problem?
 
Brian Bykenhaal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just tried to create a jar and got this error.
jar cfm TicTacToeGUIGame.jar Manifest.mf Board.class Cell.class Mark.class Outcome.class Player.class TicTacToeGU
IGame.class
java.io.IOException: invalid manifest format
at java.util.jar.Manifest.read(Manifest.java:225)
at java.util.jar.Manifest.<init>(Manifest.java:69)
at sun.tools.jar.Main.run(Main.java:172)
at sun.tools.jar.Main.main(Main.java:1177)

MY main class looks like this

Main-Class: TicTacToeGUIGame


two return spaces after the main class
 
Brian Bykenhaal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well thanks for the tip I dropped the public do I need .java after to make it the same as my class name? That is right I can only have one public class in a Java file. I added thje .java for that class name and got more errors then I wanted so I dropped the public. I still have a yellow mark but no red now by that line of code.
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic