The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Java buttons and OSX

    Discussion in 'Apple and Mac OS X' started by budgiemaster, Jun 10, 2010.

  1. budgiemaster

    budgiemaster Notebook Enthusiast

    Reputations:
    0
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    15
    Hi, everyone! I used JButtons in a game I'm coding (Battleship!!!). The board is made of JButtons that change color when they are clicked, however, I cannot see them change color on my mbp but I see them change color on my pc. I'm using Eclipse...any suggestions so I can get it to display the color change?
     
  2. bikerc

    bikerc Notebook Geek

    Reputations:
    9
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    15
    This is a question for a java developer who happens to own a Mac.

    I am a java developer but I don't own a Mac (yet). The only thing I can suggest is that you should play with the button properties on OSX. Are you running your game as an applet or did you install Eclipse or another IDE on OSX? I assume you are using Swing. What L&F do you use? There are a zillion details that you left out. A screenshot would be good too.

    I think it would be best to install your dev environment on OSX, in case you didn't already do it.
     
  3. beige

    beige Notebook Deity

    Reputations:
    105
    Messages:
    779
    Likes Received:
    1
    Trophy Points:
    30
    try "net beans" , and be sure that ur JDK is fully updated , some times eclipse have weird problems :D on mac , i was just making battle ship 2 weeks ago as my java project , its the easiest game out there that will let u learn new stuff in java for beginner .
     
  4. budgiemaster

    budgiemaster Notebook Enthusiast

    Reputations:
    0
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    15
    I'm using eclipse, Swing and I don't know what L&F is or a dev environment. I got it to work by setting each button to .setOpaque(true) and then .setBackground(Color.green); and it worked. I'm only in AP Comp Sci so up until now, most ide details have been unnecessary for me to be aware of.
     
  5. beige

    beige Notebook Deity

    Reputations:
    105
    Messages:
    779
    Likes Received:
    1
    Trophy Points:
    30
    what is ur osx version?