Re: Help required with Form Editor for JApplet - ButtonGroup

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Help required with Form Editor for JApplet - ButtonGroup

Jānis Rukšāns
Hi,

Actually you can run applet from IDE (I'm using 4.1 on w2k), I can't
even repeat the situation where Ant says there is no main method for
the applet.

What I did was:
1) Created a simple applet in my current project (Java class library),
tried to run it and Ant gave an error that there is no main method for
the applet.
2) Compiled the applet
3) Tried to debug it - OK, the applet was lauched in AppletViewer
4) Tried to run it again - OK
5) Cleaned the project and tried to run the applet - OK
6) Created a new Java application project
7) Created a similar applet in it, tried to run it - OK
8) Created a new Java class library
9) Created a similar applet in it, tried to run it - OK

I hope this will help you,
Ian

On 7/27/05, James Hodgskiss <[hidden email]> wrote:

> Hiya,
>
> Thanks for the reply. I think the problem is that I was only 'Testing' my
> Applet. I cannot 'Run' Applets from within the IDE for some reason...
>
> Cheers,
> James
>
> ----- Original Message -----
> From: "Janis Ruksans" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, July 25, 2005 1:28 PM
> Subject: Re: [nbusers] Help required with Form Editor for JApplet -
> ButtonGroup
>
>
> To set button group there should be a button group "property" in the
> properties of the button. Setting this to buttonGroup1 should generate
> the following code:
> buttonGroup.add(button1);
>
> I attached a simple app I made just to be shure it works (note that
> you must run the code to see if it's working or not).
>
> On 7/25/05, James Hodgskiss <[hidden email]> wrote:
> > Maybe am I doing something wrong??... I added buttonGroup1 (and it appears
> > in the 'Other Components' part of the Inspector. I then added two
> > JRadioButtons and associate them with the buttonGroup1.
> >
> > But selecting one button does not deselect the other button... I have
> > looked
> > at the properties for buttonGroup1 but I cannot edit any of them.
> >
> > Am I missing something?
> >
> > Cheers,
> > James
> > ----- Original Message -----
> > From: "Janis Ruksans" <[hidden email]>
> > To: <[hidden email]>
> > Sent: Monday, July 25, 2005 12:05 PM
> > Subject: Re: [nbusers] Help required with Form Editor for JApplet -
> > ButtonGroup
> >
> >
> > ButtonGroup has always worked fine for me, without any workarounds.
> >
> > On 7/25/05, James Hodgskiss <[hidden email]> wrote:
> > > Thanks Jim,
> > >
> > > That just leaves me wondering what the point is of ButtonGroup. Can I
> > > leave
> > > it out or is it required for layout purposes?
> > >
> > > Thanks,
> > > James
> > >
> > > ----- Original Message -----
> > > From: "Jim Katz" <[hidden email]>
> > > To: "NetBeans Users List" <[hidden email]>
> > > Sent: Sunday, July 24, 2005 9:57 PM
> > > Subject: [nbusers] Help required with Form Editor for JApplet -
> > > ButtonGroup
> > >
> > >
> > > > Hi James,
> > > > My code for this situation:
> > > > in the jRadioButtonFirstActionPerformed method:
> > > >
> > > > jRadioButtonSecond.setSelected ( ! jRadioButtonFirst.isSelected ());
> > > >
> > > > and in the jRadioButtonSecondActionPerformed method:
> > > >
> > > > jRadioButtonFirst.setSelected ( ! jRadioButtonSecond.isSelected ());
> > > >
> > > > HTH
> > > >
> > > > Jim
> > > >
> > > > PS It does seem rather redundant to have to write this code for a
> > > > radio
> > > > button group, when this should be the default behavior. After all
> > > > they're radio buttons, not check boxes.
> > > >
> > > >> Subject: Help required with Form Editor for JApplet - ButtonGroup
> > > >> Date: Fri, 22 Jul 2005 23:28:20 +0100
> > > >> From: "James Hodgskiss" <[hidden email]>
> > > >> To: <[hidden email]>
> > > >>
> > > >> Hiya,
> > > >>
> > > >> I'm just designing my first JApplet with Netbeans (4.1).
> > > >>
> > > >> I've added a couple of JRadioButton's to my form and associated them
> > > >> with
> > > >> the ButtonGroup I have also added.
> > > >>
> > > >> But the problem I'm getting is that both radio buttons can be
> > > >> selected
> > > >> at
> > > >> the same time... and I want it so that if one button is selected the
> > > >> other
> > > >> button will become unselected.
> > > >>
> > > >> I'm sure there's a simple solution, but I can't find it! Can someone
> > > >> help me
> > > >> out on this one?
> > > >>
> > > >> Thanks,
> > > >> James
> > > >
> > > > --
> > > > ! Jim Katz
> > > > ! Using Clarion for Windows - Always looking for the simpler solution.
> > > > ! netBeans 4.1
> > > > ! Sun Java Studio Creator
> > > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help required with Form Editor for JApplet - ButtonGroup

jhodgski
Ian,

Thanks for the reply, but I'm still getting 'Project TestApplet does not
have a main class set' - and that's despite whether I run or debug the
project...


----- Original Message -----
From: "Janis Ruksans" <[hidden email]>
To: "James Hodgskiss" <[hidden email]>; <[hidden email]>
Sent: Wednesday, July 27, 2005 8:09 AM
Subject: Re: [nbusers] Help required with Form Editor for JApplet -
ButtonGroup


Hi,

Actually you can run applet from IDE (I'm using 4.1 on w2k), I can't
even repeat the situation where Ant says there is no main method for
the applet.

What I did was:
1) Created a simple applet in my current project (Java class library),
tried to run it and Ant gave an error that there is no main method for
the applet.
2) Compiled the applet
3) Tried to debug it - OK, the applet was lauched in AppletViewer
4) Tried to run it again - OK
5) Cleaned the project and tried to run the applet - OK
6) Created a new Java application project
7) Created a similar applet in it, tried to run it - OK
8) Created a new Java class library
9) Created a similar applet in it, tried to run it - OK

I hope this will help you,
Ian

On 7/27/05, James Hodgskiss <[hidden email]> wrote:

> Hiya,
>
> Thanks for the reply. I think the problem is that I was only 'Testing' my
> Applet. I cannot 'Run' Applets from within the IDE for some reason...
>
> Cheers,
> James
>
> ----- Original Message -----
> From: "Janis Ruksans" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, July 25, 2005 1:28 PM
> Subject: Re: [nbusers] Help required with Form Editor for JApplet -
> ButtonGroup
>
>
> To set button group there should be a button group "property" in the
> properties of the button. Setting this to buttonGroup1 should generate
> the following code:
> buttonGroup.add(button1);
>
> I attached a simple app I made just to be shure it works (note that
> you must run the code to see if it's working or not).
>
> On 7/25/05, James Hodgskiss <[hidden email]> wrote:
> > Maybe am I doing something wrong??... I added buttonGroup1 (and it
> > appears
> > in the 'Other Components' part of the Inspector. I then added two
> > JRadioButtons and associate them with the buttonGroup1.
> >
> > But selecting one button does not deselect the other button... I have
> > looked
> > at the properties for buttonGroup1 but I cannot edit any of them.
> >
> > Am I missing something?
> >
> > Cheers,
> > James
> > ----- Original Message -----
> > From: "Janis Ruksans" <[hidden email]>
> > To: <[hidden email]>
> > Sent: Monday, July 25, 2005 12:05 PM
> > Subject: Re: [nbusers] Help required with Form Editor for JApplet -
> > ButtonGroup
> >
> >
> > ButtonGroup has always worked fine for me, without any workarounds.
> >
> > On 7/25/05, James Hodgskiss <[hidden email]> wrote:
> > > Thanks Jim,
> > >
> > > That just leaves me wondering what the point is of ButtonGroup. Can I
> > > leave
> > > it out or is it required for layout purposes?
> > >
> > > Thanks,
> > > James
> > >
> > > ----- Original Message -----
> > > From: "Jim Katz" <[hidden email]>
> > > To: "NetBeans Users List" <[hidden email]>
> > > Sent: Sunday, July 24, 2005 9:57 PM
> > > Subject: [nbusers] Help required with Form Editor for JApplet -
> > > ButtonGroup
> > >
> > >
> > > > Hi James,
> > > > My code for this situation:
> > > > in the jRadioButtonFirstActionPerformed method:
> > > >
> > > > jRadioButtonSecond.setSelected ( ! jRadioButtonFirst.isSelected ());
> > > >
> > > > and in the jRadioButtonSecondActionPerformed method:
> > > >
> > > > jRadioButtonFirst.setSelected ( ! jRadioButtonSecond.isSelected ());
> > > >
> > > > HTH
> > > >
> > > > Jim
> > > >
> > > > PS It does seem rather redundant to have to write this code for a
> > > > radio
> > > > button group, when this should be the default behavior. After all
> > > > they're radio buttons, not check boxes.
> > > >
> > > >> Subject: Help required with Form Editor for JApplet - ButtonGroup
> > > >> Date: Fri, 22 Jul 2005 23:28:20 +0100
> > > >> From: "James Hodgskiss" <[hidden email]>
> > > >> To: <[hidden email]>
> > > >>
> > > >> Hiya,
> > > >>
> > > >> I'm just designing my first JApplet with Netbeans (4.1).
> > > >>
> > > >> I've added a couple of JRadioButton's to my form and associated
> > > >> them
> > > >> with
> > > >> the ButtonGroup I have also added.
> > > >>
> > > >> But the problem I'm getting is that both radio buttons can be
> > > >> selected
> > > >> at
> > > >> the same time... and I want it so that if one button is selected
> > > >> the
> > > >> other
> > > >> button will become unselected.
> > > >>
> > > >> I'm sure there's a simple solution, but I can't find it! Can
> > > >> someone
> > > >> help me
> > > >> out on this one?
> > > >>
> > > >> Thanks,
> > > >> James
> > > >
> > > > --
> > > > ! Jim Katz
> > > > ! Using Clarion for Windows - Always looking for the simpler
> > > > solution.
> > > > ! netBeans 4.1
> > > > ! Sun Java Studio Creator
> > > >
> > >
> > >
> > >
> >
> >
> >
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Help required with Form Editor for JApplet - ButtonGroup

Karel Zikmund
Hi James,

have you tried run single file? (i.e. Run menu | Run file | applet file)
Running the project (F6) won't run applet - it is used only for main classes.

-Karel

James Hodgskiss wrote:

> Ian,
>
> Thanks for the reply, but I'm still getting 'Project TestApplet does not
> have a main class set' - and that's despite whether I run or debug the
> project...
>
>
> ----- Original Message ----- From: "Janis Ruksans" <[hidden email]>
> To: "James Hodgskiss" <[hidden email]>; <[hidden email]>
> Sent: Wednesday, July 27, 2005 8:09 AM
> Subject: Re: [nbusers] Help required with Form Editor for JApplet -
> ButtonGroup
>
>
> Hi,
>
> Actually you can run applet from IDE (I'm using 4.1 on w2k), I can't
> even repeat the situation where Ant says there is no main method for
> the applet.
>
> What I did was:
> 1) Created a simple applet in my current project (Java class library),
> tried to run it and Ant gave an error that there is no main method for
> the applet.
> 2) Compiled the applet
> 3) Tried to debug it - OK, the applet was lauched in AppletViewer
> 4) Tried to run it again - OK
> 5) Cleaned the project and tried to run the applet - OK
> 6) Created a new Java application project
> 7) Created a similar applet in it, tried to run it - OK
> 8) Created a new Java class library
> 9) Created a similar applet in it, tried to run it - OK
>
> I hope this will help you,
> Ian
>
> On 7/27/05, James Hodgskiss <[hidden email]> wrote:
>
>> Hiya,
>>
>> Thanks for the reply. I think the problem is that I was only 'Testing' my
>> Applet. I cannot 'Run' Applets from within the IDE for some reason...
>>
>> Cheers,
>> James
>>
>> ----- Original Message -----
>> From: "Janis Ruksans" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Monday, July 25, 2005 1:28 PM
>> Subject: Re: [nbusers] Help required with Form Editor for JApplet -
>> ButtonGroup
>>
>>
>> To set button group there should be a button group "property" in the
>> properties of the button. Setting this to buttonGroup1 should generate
>> the following code:
>> buttonGroup.add(button1);
>>
>> I attached a simple app I made just to be shure it works (note that
>> you must run the code to see if it's working or not).
>>
>> On 7/25/05, James Hodgskiss <[hidden email]> wrote:
>> > Maybe am I doing something wrong??... I added buttonGroup1 (and it >
>> appears
>> > in the 'Other Components' part of the Inspector. I then added two
>> > JRadioButtons and associate them with the buttonGroup1.
>> >
>> > But selecting one button does not deselect the other button... I have
>> > looked
>> > at the properties for buttonGroup1 but I cannot edit any of them.
>> >
>> > Am I missing something?
>> >
>> > Cheers,
>> > James
>> > ----- Original Message -----
>> > From: "Janis Ruksans" <[hidden email]>
>> > To: <[hidden email]>
>> > Sent: Monday, July 25, 2005 12:05 PM
>> > Subject: Re: [nbusers] Help required with Form Editor for JApplet -
>> > ButtonGroup
>> >
>> >
>> > ButtonGroup has always worked fine for me, without any workarounds.
>> >
>> > On 7/25/05, James Hodgskiss <[hidden email]> wrote:
>> > > Thanks Jim,
>> > >
>> > > That just leaves me wondering what the point is of ButtonGroup. Can I
>> > > leave
>> > > it out or is it required for layout purposes?
>> > >
>> > > Thanks,
>> > > James
>> > >
>> > > ----- Original Message -----
>> > > From: "Jim Katz" <[hidden email]>
>> > > To: "NetBeans Users List" <[hidden email]>
>> > > Sent: Sunday, July 24, 2005 9:57 PM
>> > > Subject: [nbusers] Help required with Form Editor for JApplet -
>> > > ButtonGroup
>> > >
>> > >
>> > > > Hi James,
>> > > > My code for this situation:
>> > > > in the jRadioButtonFirstActionPerformed method:
>> > > >
>> > > > jRadioButtonSecond.setSelected ( ! jRadioButtonFirst.isSelected
>> ());
>> > > >
>> > > > and in the jRadioButtonSecondActionPerformed method:
>> > > >
>> > > > jRadioButtonFirst.setSelected ( ! jRadioButtonSecond.isSelected
>> ());
>> > > >
>> > > > HTH
>> > > >
>> > > > Jim
>> > > >
>> > > > PS It does seem rather redundant to have to write this code for a
>> > > > radio
>> > > > button group, when this should be the default behavior. After all
>> > > > they're radio buttons, not check boxes.
>> > > >
>> > > >> Subject: Help required with Form Editor for JApplet - ButtonGroup
>> > > >> Date: Fri, 22 Jul 2005 23:28:20 +0100
>> > > >> From: "James Hodgskiss" <[hidden email]>
>> > > >> To: <[hidden email]>
>> > > >>
>> > > >> Hiya,
>> > > >>
>> > > >> I'm just designing my first JApplet with Netbeans (4.1).
>> > > >>
>> > > >> I've added a couple of JRadioButton's to my form and associated
>> > > >> them
>> > > >> with
>> > > >> the ButtonGroup I have also added.
>> > > >>
>> > > >> But the problem I'm getting is that both radio buttons can be
>> > > >> selected
>> > > >> at
>> > > >> the same time... and I want it so that if one button is
>> selected > > >> the
>> > > >> other
>> > > >> button will become unselected.
>> > > >>
>> > > >> I'm sure there's a simple solution, but I can't find it! Can >
>> > >> someone
>> > > >> help me
>> > > >> out on this one?
>> > > >>
>> > > >> Thanks,
>> > > >> James
>> > > >
>> > > > --
>> > > > ! Jim Katz
>> > > > ! Using Clarion for Windows - Always looking for the simpler > >
>> > solution.
>> > > > ! netBeans 4.1
>> > > > ! Sun Java Studio Creator
>> > > >
>> > >
>> > >
>> > >
>> >
>> >
>> >
>>
>>
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help required with Form Editor for JApplet - ButtonGroup

jhodgski
Thanks Karel, that method works!

Cheers,
James
----- Original Message -----
From: "Karel Zikmund" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, July 27, 2005 10:40 AM
Subject: Re: [nbusers] Help required with Form Editor for JApplet -
ButtonGroup


> Hi James,
>
> have you tried run single file? (i.e. Run menu | Run file | applet file)
> Running the project (F6) won't run applet - it is used only for main
> classes.
>
> -Karel
>
> James Hodgskiss wrote:
>> Ian,
>>
>> Thanks for the reply, but I'm still getting 'Project TestApplet does not
>> have a main class set' - and that's despite whether I run or debug the
>> project...
>>
>>
>> ----- Original Message ----- From: "Janis Ruksans"
>> <[hidden email]>
>> To: "James Hodgskiss" <[hidden email]>; <[hidden email]>
>> Sent: Wednesday, July 27, 2005 8:09 AM
>> Subject: Re: [nbusers] Help required with Form Editor for JApplet -
>> ButtonGroup
>>
>>
>> Hi,
>>
>> Actually you can run applet from IDE (I'm using 4.1 on w2k), I can't
>> even repeat the situation where Ant says there is no main method for
>> the applet.
>>
>> What I did was:
>> 1) Created a simple applet in my current project (Java class library),
>> tried to run it and Ant gave an error that there is no main method for
>> the applet.
>> 2) Compiled the applet
>> 3) Tried to debug it - OK, the applet was lauched in AppletViewer
>> 4) Tried to run it again - OK
>> 5) Cleaned the project and tried to run the applet - OK
>> 6) Created a new Java application project
>> 7) Created a similar applet in it, tried to run it - OK
>> 8) Created a new Java class library
>> 9) Created a similar applet in it, tried to run it - OK
>>
>> I hope this will help you,
>> Ian
>>
>> On 7/27/05, James Hodgskiss <[hidden email]> wrote:
>>
>>> Hiya,
>>>
>>> Thanks for the reply. I think the problem is that I was only 'Testing'
>>> my
>>> Applet. I cannot 'Run' Applets from within the IDE for some reason...
>>>
>>> Cheers,
>>> James
>>>
>>> ----- Original Message -----
>>> From: "Janis Ruksans" <[hidden email]>
>>> To: <[hidden email]>
>>> Sent: Monday, July 25, 2005 1:28 PM
>>> Subject: Re: [nbusers] Help required with Form Editor for JApplet -
>>> ButtonGroup
>>>
>>>
>>> To set button group there should be a button group "property" in the
>>> properties of the button. Setting this to buttonGroup1 should generate
>>> the following code:
>>> buttonGroup.add(button1);
>>>
>>> I attached a simple app I made just to be shure it works (note that
>>> you must run the code to see if it's working or not).
>>>
>>> On 7/25/05, James Hodgskiss <[hidden email]> wrote:
>>> > Maybe am I doing something wrong??... I added buttonGroup1 (and it >
>>> appears
>>> > in the 'Other Components' part of the Inspector. I then added two
>>> > JRadioButtons and associate them with the buttonGroup1.
>>> >
>>> > But selecting one button does not deselect the other button... I have
>>> > looked
>>> > at the properties for buttonGroup1 but I cannot edit any of them.
>>> >
>>> > Am I missing something?
>>> >
>>> > Cheers,
>>> > James
>>> > ----- Original Message -----
>>> > From: "Janis Ruksans" <[hidden email]>
>>> > To: <[hidden email]>
>>> > Sent: Monday, July 25, 2005 12:05 PM
>>> > Subject: Re: [nbusers] Help required with Form Editor for JApplet -
>>> > ButtonGroup
>>> >
>>> >
>>> > ButtonGroup has always worked fine for me, without any workarounds.
>>> >
>>> > On 7/25/05, James Hodgskiss <[hidden email]> wrote:
>>> > > Thanks Jim,
>>> > >
>>> > > That just leaves me wondering what the point is of ButtonGroup. Can
>>> > > I
>>> > > leave
>>> > > it out or is it required for layout purposes?
>>> > >
>>> > > Thanks,
>>> > > James
>>> > >
>>> > > ----- Original Message -----
>>> > > From: "Jim Katz" <[hidden email]>
>>> > > To: "NetBeans Users List" <[hidden email]>
>>> > > Sent: Sunday, July 24, 2005 9:57 PM
>>> > > Subject: [nbusers] Help required with Form Editor for JApplet -
>>> > > ButtonGroup
>>> > >
>>> > >
>>> > > > Hi James,
>>> > > > My code for this situation:
>>> > > > in the jRadioButtonFirstActionPerformed method:
>>> > > >
>>> > > > jRadioButtonSecond.setSelected ( ! jRadioButtonFirst.isSelected
>>> ());
>>> > > >
>>> > > > and in the jRadioButtonSecondActionPerformed method:
>>> > > >
>>> > > > jRadioButtonFirst.setSelected ( ! jRadioButtonSecond.isSelected
>>> ());
>>> > > >
>>> > > > HTH
>>> > > >
>>> > > > Jim
>>> > > >
>>> > > > PS It does seem rather redundant to have to write this code for a
>>> > > > radio
>>> > > > button group, when this should be the default behavior. After all
>>> > > > they're radio buttons, not check boxes.
>>> > > >
>>> > > >> Subject: Help required with Form Editor for JApplet - ButtonGroup
>>> > > >> Date: Fri, 22 Jul 2005 23:28:20 +0100
>>> > > >> From: "James Hodgskiss" <[hidden email]>
>>> > > >> To: <[hidden email]>
>>> > > >>
>>> > > >> Hiya,
>>> > > >>
>>> > > >> I'm just designing my first JApplet with Netbeans (4.1).
>>> > > >>
>>> > > >> I've added a couple of JRadioButton's to my form and associated
>>> > > >> them
>>> > > >> with
>>> > > >> the ButtonGroup I have also added.
>>> > > >>
>>> > > >> But the problem I'm getting is that both radio buttons can be
>>> > > >> selected
>>> > > >> at
>>> > > >> the same time... and I want it so that if one button is
>>> selected > > >> the
>>> > > >> other
>>> > > >> button will become unselected.
>>> > > >>
>>> > > >> I'm sure there's a simple solution, but I can't find it! Can >
>>> > >> someone
>>> > > >> help me
>>> > > >> out on this one?
>>> > > >>
>>> > > >> Thanks,
>>> > > >> James
>>> > > >
>>> > > > --
>>> > > > ! Jim Katz
>>> > > > ! Using Clarion for Windows - Always looking for the simpler > >
>>> > solution.
>>> > > > ! netBeans 4.1
>>> > > > ! Sun Java Studio Creator
>>> > > >
>>> > >
>>> > >
>>> > >
>>> >
>>> >
>>> >
>>>
>>>
>>>
>>
>>
>