User Profile

Collapse

Profile Sidebar

Collapse
tommyny04
tommyny04
Last Activity: Dec 2 '07, 08:57 PM
Joined: Sep 30 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • tommyny04
    started a topic Setting JColorChoose to a button
    in Java

    Setting JColorChoose to a button

    Hi all, I'm trying to write code so that when a button is clicked, a JColorChooser pops up. For some reason, the code I wrote i snot working and I can't figure out the reason. Any help would be greatly appreciated thanks.

    [CODE]

    private static JButton changeColorButt on = new JButton("Change Color");
    private static JButton loadButton = new JButton("Open") ;

    public void actionPerformed (ActionEvent...
    See more | Go to post

  • tommyny04
    started a topic Drawing Images
    in Java

    Drawing Images

    I have a picture(a map) drawn to a panel using a BufferedImage and I want to draw circle on different parts of the map. I'm using a Graphics object to draw the circles onto the map but everytime I call the repaint function, everything I've drawn on the map disappears. Really need help with this. The following functions are the functions that draws the map unto the panel and the function that draws the images unto the map. Am I doing something wrong...
    See more | Go to post

  • tommyny04
    replied to Updating a JLabel to a JPanel
    in Java
    nevermind, figured it out
    See more | Go to post

    Leave a comment:


  • tommyny04
    started a topic Updating a JLabel to a JPanel
    in Java

    Updating a JLabel to a JPanel

    I have a method addPlayer that's supposed to add a JLabel to a JPanel and update the JPanel. The JLabel is just a label with a player's name in it. The code I've wrote doesn't work and I'm not sure why. Any help would be greatly appreciated

    Code:
        int playerCount = 0;
        private void addPlayerButtonActionPerformed(java.awt.event.ActionEvent evt) {                                                
            String name
    ...
    See more | Go to post

  • tommyny04
    started a topic waiting for a mouse click
    in Java

    waiting for a mouse click

    Really need help with this one. I'm writing a program to simulate a Risk game and I need to write a method to make two countries neighbors, which would be done by adding each the neighbor country to each country's neighbor's array. To do this, I will need to click on the country, click on the map and then click on the other country. My method gets the country's name but how do I tell it to wait for a mouse click before trying to get the second country's...
    See more | Go to post

  • tommyny04
    started a topic Displaying images in Java
    in Java

    Displaying images in Java

    I'm kinda new to programming but I usually figure things out by myself but I need help with this. I'm trying to display an image in the Center region of a JFrame and other icons/button in the other regions. So far, I have this:

    [code=java]
    public class RiskFrame extends JFrame implements ActionListener, MouseListener{

    private BufferedImage bImage;
    private Image image;

    private JPanel...
    See more | Go to post
    Last edited by JosAH; Sep 30 '07, 11:46 AM. Reason: added [code] ... [/code] tags
No activity results to display
Show More
Working...