4
Contributors
5
Replies
20
Views
3 Years
Discussion Span
Last Post by stultuske
0

^ like he said.
Post the code you use to create and set the initial position of the button, so someone can give you the appropriate answer.

0

here is the code

button  button = new JButton();

    public Mainmenu() {
        setLayout(new FlowLayout());

        Icon button1= new ImageIcon(getClass().getResource("button.jpg"));
        play=new JButton(button1);
        add(button);

        HandlerC hand = new HandlerC();
        button.addActionListener(hand);

    }       
    private class HandlerC implements ActionListener {
        public void actionPerformed(ActionEvent e) {            

        }
    }
    }
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.