Robben_Ford_Fan_boy
Robben_Ford_Fan_boy

Reputation: 8738

Java SWT: Change colour of line when using GC.drawline

If I am drawing a line using:

GC.drawLine(int x1, int y1, int x2, int y2);

How do I change the colour of the line?

I can change the transparency by calling:

gc.setAlpha(150);

But I cannot find method of changing the colour of the line

Upvotes: 0

Views: 500

Answers (1)

Enak
Enak

Reputation: 596

Draw functions draw with the foreground color:

gc.setForeground(display.getSystemColor(SWT.COLOR_BLUE));

Upvotes: 3

Related Questions