This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Printing the StyledText value - SWT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Printing the StyledText value - SWT" Watch "Printing the StyledText value - SWT" New topic

Printing the StyledText value - SWT

Carl John
Ranch Hand

Joined: Jun 14, 2010
Posts: 47

Hi All,

I'm newbie in SWT . I'm trying to print the StyledText value into an image format. I don't know how to deal with StyledText. My code snippet is

final StyledText styledText = new StyledText(shell, SWT.V_SCROLL | SWT.BORDER);

styledText.setText("HELLO WORLD");

styledText.setStyleRange(new StyleRange(0, 5, display.getSystemColor(SWT.COLOR_GREEN), null));

styledText.setStyleRange(new StyleRange(7, 11, display.getSystemColor(SWT.COLOR_RED), null));


Anyone please guide me...!

Very Thanks in advance..!

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Printing the StyledText value - SWT