[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
] [
Newsgroup Home
]
[news.eclipse.platform.swt] Border in form layout
From
:
arno.nymix@xxxxxxxxx
(Arno Nymix)
Date
: Wed, 15 Nov 2006 16:33:44 +0000 (UTC)
Newsgroups
:
eclipse.platform.swt
Organization
: Eclipse
User-agent
: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
Hello
I found a way to add a border around a text widget here:
http://www.java-tips.org/other-api-tips/eclipse/how-to-add-colored-border-around-the-text-widgets.html
Now I need a that in a form layout. Does somebody know how to do that?
Thx Arno
Code:
1. private void initialize() {
2. GridData g=new GridData();
3. g.grabExcessHorizontalSpace=true;
4. g.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
5. Label label=new Label(this,SWT.NONE);
6. label.setText("Bordered Text");
7. text = new Text(this, SWT.NONE);
8. text.setBounds(new org.eclipse.swt.graphics.Rectangle(92,40,84,28));
9. text.setLayoutData(g);
10. addPaintListener(new PaintListener() {
11. public void paintControl(PaintEvent e) {
12. GC gc=e.gc;
13. Color red=new Color(null,255,0,0);
14. gc.setBackground(red);
15. Rectangle rect=text.getBounds();
16. Rectangle rect1 = new Rectangle(rText.x-1, rText.y-1, 17. rText.width+2, rText.height+2);
18.
19. gc.fillRectangle(rect1);
20. addControlListener(new ControlAdapter() {
21. public void controlResized(ControlEvent e) {
22. super.controlResized(e); 21. }
23. });
24. }
25 });
26.}
Prev by Date:
[news.eclipse.platform.swt] Re: No more handles during startup of AGR test on Linux
Next by Date:
[news.eclipse.platform.swt] Color of close button in CTabFolder
Previous by thread:
[news.eclipse.platform.swt] multiple lines in a TreeItem
Next by thread:
[news.eclipse.platform.swt] Color of close button in CTabFolder
Index(es):
Date
Thread