- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
10 Posted Topics
Re: Hi. First off, I would suggest to use, on line 86, [CODE] if (seatStatus[crownum-1][cseatnum-1].equals("Open")) [/CODE] Also, put everything you want that IF statement (the one I talked about above) to do in curly brackets. As of now, on the code here, the only statement that the IF is executing is … | |
Re: Without an array, you'd just have to make 9 separate variables, each corresponding with a row and column on the board. For example [code] int space11 = 0; //Row 1 Col 1, 0 is an O and 1 is an X [/code] space12 would be row 1 col 2 and … | |
Re: Try changing [CODE]for (int row=0; row<=10; row++){ for (int col=0; col<=10; col++) { int num = RandomNumber(); position [row][col] = tile[num]; icons[size] = tile[num]; size--; } }[/CODE] to [CODE]for (int row=0; row<10; row++){ for (int col=0; col<10; col++) { int num = RandomNumber(); position [row][col] = tile[num]; icons[size] = tile[num]; … | |
Re: Sometimes when I am using Eclipse on different computers, I will have different JRE's installed. For example, I use JRE7 on one and the other has JRE6 installed. When I go from one to the other, Eclipse throws a ton of errors. So make sure whatever JRE you used to … | |
Re: Do you just mean you want to read the line from the .txt file into your program? Or something different? | |
Re: A search in the Official Java SE 7 Documentation turns up nothing, although I've seen a few people talking about it in a Google search. Does your book talk about having to downloading it or anything, because some books will use secondary classes not in the standard JDK to illustrate … | |
Re: This is just the code in the code tags: [CODE]import javax.swing.*; import java.awt.*; public class ScorePanel extends JPanel{ JLabel scoreLabel; Player player; // ScorePanel constructor public ScorePanel(Player user){ player = user; // Main panel setPreferredSize(new Dimension(150,100)); setBackground(Color.lightGray); JLabel label = new JLabel(player.name()); label.setFont (new Font("Arial", Font.BOLD, 20)); add(label); // Score … | |
Re: You could try getting rid of getClass().getResource and just put in the image name. Whenever I make an ImageIcon, I usually only put the file path in parentheses. Try it, see how it works. | |
Re: There is no method in the AudioClip class itself to return this value (as I'm sure you've already figured out). If you're looping the sound, what I would do is declare a boolean variable and change it when you start or stop the loop. For example: [CODE] boolean isPlaying = … | |
Re: I personally prefer learning Swing. While GUI designers are great things to start with, I think that typing out the code yourself has greater benefits in the long run. Also, it is interesting to see how Swing works, too. Granted, GUI designers are real time savers if you need to … |
The End.