Search:

Type: Posts; User: captain

Search: Search took 0.50 seconds.

  1. Saving current state of GUI to be opened later

    How would I go about doing this? I have a program with a lot of objects (JButtons, JLists, Tabs, etc.) that I need to be able to save to a file during any time that my program is running and then be...
  2. Re: previous tab's functions no longer working when new tab is created

    that was in there with my save code. I just forgot to take it out
  3. Re: previous tab's functions no longer working when new tab is created

    I could only see one possibility that was in the main method. I changed it to Example ex = new Example(); I honestly don't know what else it could be. It compiles in eclipse for me.
  4. Re: previous tab's functions no longer working when new tab is created

    I was able to cut it down to about 340 lines and it still compiles

    import javax.swing.DefaultListModel;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JComboBox;...
  5. Re: previous tab's functions no longer working when new tab is created

    Wow i'm sorry. I cut some of the methodcreation class out. hope that helps. also the jbuttons have icons set for them, but that shouldn't stop it from compiling
  6. Re: previous tab's functions no longer working when new tab is created

    I'm sorry I just tried to cut it down as much as possible. i edited it. check again please
  7. Re: previous tab's functions no longer working when new tab is created

    Ok i cut it down as much as I could. still a lot to read through, sorry..

    Basically the program allows the user to create a java program with visuals then translate it into code and export it to a...
  8. previous tab's functions no longer working when new tab is created

    So I've created a program that allows you to create a tab when you click on a JButton. that button allows you to name the tab and then it is created. once the tab is created, it adds a new JPanel to...
  9. Adding an actionlistener to a JButton with no text

    I'm having trouble figuring this out. I would normally just do something like


    JButton blah = new JButton("blah");

    String str = e.getActionCommand();
    if(str.equals("blah") {
    //do something
    }
  10. Replies
    1
    Views
    1,351

    Perpendicular Lines

    I'm trying to write a program that can create lines in a JPanel by clicking and dragging the mouse. That part I have down. The next thing I'm trying to do is create a perpendicular line to the line...
  11. Replies
    2
    Views
    542

    [SOLVED] array not shuffling

    nvm guys answered my own question
  12. Replies
    1
    Views
    652

    GridLayout/JButton/MouseListener question

    Hey everyone. I'm trying to create a MouseListener event so that when a Tile is clicked on my grid it will black out all tiles that are of the same color as the one I clicked, except the one I...
  13. Replies
    11
    Views
    1,037

    [SOLVED] Re: Random Colors Problem

    I got it guys! I kinda worked through it my own way. It may not be the most efficient but tell me what ya think. I ended up avoiding 2D arrays altogether and just used the gridlayout.

    Thanks for...
  14. Replies
    11
    Views
    1,037

    [SOLVED] Re: Random Colors Problem

    Sorry about this guys but I'm still having trouble. I just can't seem to get it to color only a certain amount of tiles. It either colors them all one color or gives me a nullpointer at
  15. Replies
    3
    Views
    1,806

    Re: Distance between 2 points

    that is my code. the only error I'm getting is a type mismatch where I would have been putting the equation that I posted above. I understand why its giving me that, but I'm not sure what the correct...
  16. Replies
    3
    Views
    1,806

    Distance between 2 points

    So I've been given a practice test for one of my CSC courses that is asking me this:

    Provide the definition for the Java class Point so that it supports
    the three Java statements that appear...
  17. Replies
    11
    Views
    1,037

    [SOLVED] Re: Random Colors Problem

    so you're basically saying something like this

    public void setColor() {
    for(int i = 0; i < tiles.length; i++)
    if(tiles[i] == null){
    setBackground(Color.YELLOW);...
  18. Re: Assigning Colors in a 2D array in a random order

    Well my thought process for that piece of code was that it would set the i-th tile in the array to yellow. I'm not sure where I would assign a value to it initially though.
  19. Re: Assigning Colors in a 2D array in a random order

    Exception in thread "main" java.lang.NullPointerException
    at Tile.setColor(Tile.java:16)
    at GameBoard.buildTilePanel(GameBoard.java:55)
    at GameBoard.<init>(GameBoard.java:39)
    at...
  20. Assigning Colors in a 2D array in a random order

    Alright so basically what I'm trying to do is create a 16x16 square board of tiles (256 total) and when I run the program I need it to set up the tiles randomly into the following colors
    39...
  21. Replies
    11
    Views
    1,037

    [SOLVED] Random Colors Problem

    Alright so basically what I'm trying to do is create a 16x16 square board of tiles (256 total) and when I run the program I need it to set up the tiles randomly into the following colors
    39...
Results 1 to 21 of 21