Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

hay guys

Name: Anonymous 2007-07-13 18:15 ID:TSeIdDYm

hay i'm using java to make a little app of sorts and i'm having some problems with making a gui.

i'm wondering how to make a button click rename the button that you clicked.. I tried making the button a class variable and calling the button.setName method on it but it didn't do anything. maybe a way to refresh/redraw the gui?

the whole actionlistener deal is sort of confusing >:O

any halp would be appreciated, i'm using JFrames and JButtons here

ty, and yes i am a noob

Name: Anonymous 2007-07-13 18:23 ID:bBQOT3W2

Stop using Java and go use a real programming language...

Name: Anonymous 2007-07-13 18:27 ID:+MuZR1ue

I didn't know the answer to your problem but I'm in a good mood so I decided to look it up.

You need to use the setText method, not setName. That is all.

Name: Anonymous 2007-07-13 18:27 ID:+MuZR1ue

Name: Anonymous 2007-07-13 18:41 ID:V7ny4Gtg

[code]final JButton b = new JButton("aaa");
b.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        b.setText("bbb");
    }
} );[code]

*unfnf* java gets me so fucking hard

Name: Anonymous 2007-07-13 18:41 ID:Heaven

FUCK

Name: Anonymous 2007-07-13 19:46 ID:TSeIdDYm

thanks guys :D

Name: Anonymous 2009-02-25 7:53


Jframes and JButtons here   ty and yes   i am a   proud American down   to every last   fibre and you   get the hang   of watching parens.

Don't change these.
Name: Email:
Entire Thread Thread List