• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reusing the same objects in swing

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I reuse the same object in a swing?
I have this code (given below) and want to use the same lblBlank11 at all places where I have given lblBlankxx? But when i do this the desgin changes totally. Please help


pnlInitiator.setLayout( new GridLayout(7,4) );
pnlInitiator.add(lblBlank11);
pnlInitiator.add(lblBlank12);
pnlInitiator.add(lblBlank13);
pnlInitiator.add(lblBlank14);
pnlInitiator.add(lblName1);
pnlInitiator.add(txtFldName1);
pnlInitiator.add(lblBlank15);
pnlInitiator.add(lblBlank16);
pnlInitiator.add(lblBlank17);
pnlInitiator.add(lblBlank18);
pnlInitiator.add(lblBlank19);
pnlInitiator.add(lblBlank20);
pnlInitiator.add(lblTelNoOff1);
pnlInitiator.add(txtFldTelNoOff1);
pnlInitiator.add(lblBlank3);
pnlInitiator.add(lblBlank4);
pnlInitiator.add(lblBlank21);
pnlInitiator.add(lblBlank22);
pnlInitiator.add(lblBlank23);
pnlInitiator.add(lblBlank24);
pnlInitiator.add(lblRemarksTab1);
pnlInitiator.add(scpRemarks1);
pnlInitiator.add(lblBlank25);
pnlInitiator.add(lblBlank26);
pnlInitiator.add(lblBlank27);
pnlInitiator.add(lblBlank28);
pnlInitiator.add(lblBlank29);
pnlInitiator.add(lblBlank30);
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you cannot add the same label to multiple Containers or to the same Container multiple times.

D.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic