The Artima Developer Community
Sponsored Link

Java Answers Forum
Can anyone please help with this problem

1 reply on 1 page. Most recent reply: Aug 7, 2002 8:32 PM by Adrian

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Adrian

Posts: 3
Nickname: aw
Registered: Jul, 2002

Can anyone please help with this problem Posted: Aug 7, 2002 8:25 PM
Reply to this message Reply
Advertisement
Hi all,

Is there anyway to change the icon picture (from the stupid coffee cup) that your JFrame has in its top left corner and icon picture that is down in the windows task bar to your own picture? I have looked everywhere but can't find the answer.

Also, I have another problem. I am creating JCheckBoxes from a list of questions the user has made up himself. The questions are stored in a vector as a String. I am created the JCheckBoxes like the following in a loop.

panel.add(new JCheckBox(String from Vector));

I have no problems so far. But how then do I add an item or action listener to the JCheckBox. I can find no way of accessing it. All I can do is access it as a component from the panel I added the checkbox to, but this does not let me access the checkbox features.
Does anyone how I can get around this problem?

Thanks so much for any help

Adrian


Adrian

Posts: 3
Nickname: aw
Registered: Jul, 2002

Re: Can anyone please help with this problem Posted: Aug 7, 2002 8:32 PM
Reply to this message Reply
I did some more experimenting and I found my answer to my JCheckBox problem. All I did was,

((JCheckBox)JPanel.getComponent(0)).addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
}
});

and it worked. Its strange as this is how I was trying to do it before and it didn't work. I must have been doint something wrong!!!

If anyone can tell me how to fix my JFrame icon problem I would be grateful.

Adrian

Flat View: This topic has 1 reply on 1 page
Topic: Print a hard-copy, how? Previous Topic   Next Topic Topic: preparing a zip file using GZipOutputStream class

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use