aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Reusing the same objects in swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Reusing the same objects in swing" Watch "Reusing the same objects in swing" New topic
Author

Reusing the same objects in swing

Nithya Venkatraman
Ranch Hand

Joined: Apr 11, 2004
Posts: 39
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);


Nithya<br />SCJP(1.2), SCWCD(1.4)
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
No, you cannot add the same label to multiple Containers or to the same Container multiple times.

D.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reusing the same objects in swing