Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Update label text
Update label text [message #635408] Tue, 26 October 2010 16:51 Go to next message
ash is currently offline ashFriend
Messages: 142
Registered: July 2010
Senior Member
Hi,

how to update label text on button click or renitilize the label text
public void createControl(Composite parent) {
.
.
.
final Label label_6 = new Label(container, SWT.NONE);
label_6.setText("");
.
.
.

}
Button button = new Button(container, SWT.NONE);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
System.out.println("lksjdalkf");
label_6.setText("kjhawdjhfjawrefffffffffffkh");
}
});

on button click i nnned to update the label content

its not display the new text
even after inviking redraw or update method for label can any one tell whts is the problem

Thnaks
ashok
Re: Update label text [message #635492 is a reply to message #635408] Wed, 27 October 2010 05:16 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 26.10.2010 18:51, ashok_kumar_rr@yahoo.com wrote:
> Hi,
>
> how to update label text on button click or renitilize the label
> text public void createControl(Composite parent) { . . . final Label
> label_6 = new Label(container, SWT.NONE); label_6.setText(""); . . .
>
> } Button button = new Button(container, SWT.NONE);
> button.addSelectionListener(new SelectionAdapter() { @Override public
> void widgetSelected(SelectionEvent e) {
> System.out.println("lksjdalkf");
> label_6.setText("kjhawdjhfjawrefffffffffffkh"); } });
>
> on button click i nnned to update the label content its not display
> the new text even after inviking redraw or update method for label
> can any one tell whts is the problem

Please read the documentation of the valid style flags for the
constructor Button (Composite parent, int style) - SWT.NONE is not a
valid one for org.eclipse.swt.widgets.Button.

HTH & Greetings from Bremen,

Daniel Krügler
Re: Update label text [message #636113 is a reply to message #635408] Fri, 29 October 2010 11:12 Go to previous message
karthikeyan  is currently offline karthikeyan Friend
Messages: 6
Registered: July 2009
Junior Member
@Override
public void createPartControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout());

final Label label = new Label(composite, SWT.BORDER);
label.setText("Select the File::");


Button button = new Button(composite, SWT.BORDER);
button.setText("Change Label Text");

button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
label.setText("New Updated Text");
super.widgetSelected(e);
}
});
}



Thanks and Regards
Karthikeyan
Previous Topic:Implement ViewerFilter for checkbox tree
Next Topic:View Refresh Problem
Goto Forum:
  


Current Time: Fri Nov 28 22:12:57 GMT 2014

Powered by FUDForum. Page generated in 0.10358 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software