Search:

Type: Posts; User: Daigan

Search: Search took 0.12 seconds.

  1. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    but if my miscounted wount it be outofbounds?
  2. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    63, I changed the for loop from 7 to 63.
  3. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    Here's the whole code:

    // The "TicTacToe3d" class.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import hsa.*;
    public class TicTacToe3D extends JFrame...
  4. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    // The "TicTacToe3d" class.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import hsa.*;

    public class TicTacToe3D implements ActionListener
    {
  5. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    So I think what's supposed to happen is that I make three panels say like this

    [] - First panel
    [] - Second panel
    [] - Third panel

    Then inside those panel there should be 9 buttons arrange in...
  6. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    They pretty much just went in the center..
  7. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    So I tried the FlowLayout Manager, but the buttons didn't go inside the panels


    panelB1.setLayout (new FlowLayout ());
    panelB1.setBorder (BorderFactory.createLineBorder (Color.BLACK,...
  8. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    Alright, thanks I was able to add it. Is there a layout manager for the Panels?
  9. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    So here's the whole code:


    // The "TicTacToe3d" class.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import hsa.*;
  10. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    So I should just make 3 panels like snowguy13 said, right? So that the references to the first two objects won't be lost after the loop.
  11. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    Oh I just changed SingleBoard to GameBoard. My problem right now is I'm not sure how to add the JButtons to the panels because of the error, which I'm not sure how to fix..
  12. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    private JButton buttons[] = new JButton [9];
    JPanel panel[] = new JPanel [3];

    private boolean checkWin = false;
    //Count turns starts at 0
    int count = 0;

    //X or O variable...
  13. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    Re: JPanel

    Not exactly the values, lets say I want to access two arrays of JButton which are

    buttons[0] and buttons[1]

    I can access them fine on the last panel but, I don't know how to access them on the...
  14. Thread: JPanel

    by Daigan
    Replies
    25
    Views
    1,095

    JPanel

    class SingleBoard extends JPanel
    {
    public SingleBoard (ActionListener e)
    {
    setLayout (new GridLayout (3, 3));
    for (int i = 0 ; i <= 8 ; i++)
    ...
  15. Thread: Do while help

    by Daigan
    Replies
    15
    Views
    597

    Re: Do while help

    Alright, thanks for your advice.
  16. Thread: Do while help

    by Daigan
    Replies
    15
    Views
    597

    Re: Do while help

    I'm expecting the loop in the intro method to keep looping if the user inputs a number other than 0. Same goes for the mainmenu method, I expect it to keep asking an input until it gets either a 5,3,...
  17. Thread: Do while help

    by Daigan
    Replies
    15
    Views
    597

    Re: Do while help

    // The "LiquidConversion" class.
    import java.awt.*;
    import hsa.Console;

    public class LiquidConversion
    {
    static Console c; // The output console
    static String procstr;
    ...
  18. Thread: Do while help

    by Daigan
    Replies
    15
    Views
    597

    Re: Do while help

    I removed the true in the while statement. And changed that from true to false and it still doesn't loop. Doesn't it mean that while runLoop is true don't stop looping?
  19. Thread: Do while help

    by Daigan
    Replies
    15
    Views
    597

    Re: Do while help

    // The "LiquidConversion" class.
    import java.awt.*;
    import hsa.Console;

    public class LiquidConversion
    {
    static Console c; // The output console
    static String procstr;
    ...
  20. Thread: Do while help

    by Daigan
    Replies
    15
    Views
    597

    Re: Do while help

    Yeah it still doesn't work though I changed it to this.


    if (proc == 5 || proc ==3 || proc == 2)
    runLoop = false;
    runLoop is declared as a Boolean and true.
  21. Thread: Do while help

    by Daigan
    Replies
    15
    Views
    597

    Re: Do while help

    cause it keeps on going if I don't.
  22. Thread: Do while help

    by Daigan
    Replies
    15
    Views
    597

    Do while help

    public void mainmenu ()
    {
    title ();
    System.out.print("If you wish to exit press 5, if you want to go the intro press 2, and if you want to continue 3:");

    do
    ...
Results 1 to 22 of 22