Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Draw text on composite
Draw text on composite [message #492143] Mon, 19 October 2009 06:20
bao is currently offline baoFriend
Messages: 1
Registered: July 2009
Junior Member
hey, all, now i want to put a new transparent composite on the top of
the clock, so i can draw some text on the composite. But i have met the
problem, I couldn't put the new transparent composite on the top of the
clock. Anyone can help me?

public class Snippet3
private OleAutomation player;

public Snippet3()
final Display display = new Display();
Shell shell = new Shell(display);
Composite c1 = new Composite(shell,SWT.NONE);
shell.setLayout(new FillLayout());
c1.setLayout(new FillLayout());
OleControlSite controlSite;

OleFrame frame = new OleFrame(c1,SWT.NONE);
controlSite = new OleControlSite(frame,SWT.NONE,"WMPlayer.OCX");
catch (SWTError e)
System.out.println("Unable to open activeX control");
player = new OleAutomation(controlSite);

c1.setFocus(); // prevents vm from crashing on shutdown.


setUIMode("none"); // does not display anything without this line.

while ( !shell.isDisposed())
if ( !display.readAndDispatch())


public boolean loadFile(String URL) {
int[] ids = player.getIDsOfNames(new String[] { "URL" });
if (ids != null) {
Variant theFile = new Variant(URL);
return player.setProperty(ids[0], theFile);
return false;

private void setUIMode(String s) {
int ids[] = player.getIDsOfNames(new String[] { "uiMode" });
if (ids != null) {
player.setProperty(ids[0], new Variant(s));

public static void main(String[] args) {
new Snippet3();
Previous Topic:SOLVED: Text setText Issue Verification
Next Topic:Browser sessions get cleared
Goto Forum:

Current Time: Sat Aug 08 04:35:07 GMT 2020

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

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

Back to the top