Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Strange !!!!

Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
Please ignore the subject matter of this topic, i'm sure its not strange at all. just bcoz i'm in need of a urgent solution thats why I gave the subject name - strange.
Here is my problem :
I have created 2 Checkbox instances and 3 panels , now I wanna
add these two checkboxes on all the three panels and later 3 panels on the applet but its not happening !! Or is it that - to put 2 checkboxes on each of the panels, i will have to create 6 Checkbox instances ? Cant I work with 2 Checkbox instances only becoz if i have 2 Checkbox instances , cant I put these two on different panels ? Whats the reason ? Following is the code :
import java.awt.*;
import java.applet.*;
public class Rest extends Applet {
Checkbox c1,c2;
Panel p1,p2,p3;
public void init()
setLayout(new FlowLayout());
c1=new Checkbox("1");
c2=new Checkbox("2");
p1=new Panel();
p2=new Panel();
p3=new Panel();
p1.setLayout(new GridLayout(4,0));
p2.setLayout(new GridLayout(4,0));
p3.setLayout(new GridLayout(4,0));

please let me know. Thanx iun advance.

[This message has been edited by Sam (edited January 02, 2001).]
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't put 1 object (your checkbox) on 3 separate panels at the same time. If you could do that and a person clicked one of the checkboxes, all 3 would reflect the click (since you would be saying "this is ONE object imaged 3 times".
You need the 6 checkboxes.
    Bookmark Topic Watch Topic
  • New Topic