Jose Pérez

Greenhorn
+ Follow
since Jul 19, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jose Pérez

I finally found the solution

Then, it´s just simple like comment the .setVisible(true) in the frames of the classes that you are going to put in one single window in a main program.

Cheers.
14 years ago
Sorry Rob, I think I expressed myself wrong ( I´m from Spain)

The point its that the program generates a blank window under the main program for each exercise class of mine that I add to the main program, like I pointed in the image:



That means, I have 3 blank windows when I execute my complete main program with my three exercises together.

¿What you say is that is the normal thing? because if it is, I prefer to do 3 separated jars.

14 years ago
Thanks for the point Rob. In the CardLayout tutorial, I found the JTabbedPane, that I think its more suitable for my scenario.

But now I get a similar problem, for each exercise I put in the tabbedpane, I got a blank window under the main window.

In the image, I have put one exercise (tab 1, I don´t modified the title), and that is the blank window under I get:



¿Is the problem then in the classes constructor I put above?
14 years ago
Hi guys, I´m making an interface for some math exercises. I have a window per exercise (3 now) and now I want to work with all of them in one single window, by clicking a button in the main window, and replacing the content of it with the content of the window of the exercises choose.

But with my actual skills, what I get is a new window over the main. I think I should change the constructor of the exercises classes, but I don´t know how.

¿How can I fix this?


The code for each exercise window (all whit the same structure) is this:



And the code for the three JButton of the main window is:





Cheers.
14 years ago
That´s it -.-' , thank you David
14 years ago
Hi again guys!

I have unknown trouble with my code. I have a class Planta, and I´m trying to make the JUnit test class for it.

Planta code is:



Then, I start JUnit class and try to do this in it:



Eclipse says in planta1.setInferior(planta0); sentence:

Multiple markers at this line
- Syntax error on token "planta0", VariableDeclaratorId expected after this token
- Syntax error on token(s), misplaced construct(s)


I have made another JUnit test classes, but now I cannot see where the problem is.

Regards.
14 years ago
Hi again, I tried everything and finally fixed it setting the table size and using pack(), thank you very much everybody !

14 years ago
Such a thing, it worked



Now the problem is the size, I tried all of this:




But as you can see at the image, width is always the same, but height works perfectly, ¿where I should set the size?
14 years ago

K. Tsang wrote:Welcome to the Ranch.

The error is pretty obvious: "No such method". So did you type the method correctly?



Do you mean at the system (main) class?

In it, I call to the player with a button:






Rob Prime wrote:it's the constructor.


In this case, I thought the problem was the missing public at:



but eclipse throws the same error. No idea what´s the mistake.
14 years ago
Hi,

I´m trying to make the Bingo Game (UK):



I have written two classes, main system, and players.
In the system, I generate the content for the card in a bidimensional array, and send it to the player classes via parameter, in which i get the error. The content is ok, I print it before in console.
The player should show a JTable with the content of that array, I have tested my player JTable with basic examples and everything ok, but now I don´t know what is wrong.



Class Player Code:


And the errors:



Thanks in advance, and apologies for my english (writing from Spain).
14 years ago