The Artima Developer Community
Sponsored Link

Design Forum
Fit tabs in multi rows using SWT

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Bianca Franco

Posts: 1
Nickname: biancafr
Registered: Mar, 2006

Fit tabs in multi rows using SWT Posted: Mar 8, 2006 11:43 AM
Reply to this message Reply
Advertisement
Hi, I´ve been trying to fit tabs in multi rows, just like System Properties in Windows Control Panel does, for instance. I´ve been using RowLayout and wrap properties, but I haven´t had success. I´m sending the code below, I know if I were using buttons, it would work... Could anyone help me? Thanks!

import org.eclipse.swt.*;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.*;


public class Snippet76 {

public static void main (String [] args) {
Display display = new Display ();
final Shell shell = new Shell (display);
final TabFolder tabFolder = new TabFolder (shell, SWT.BORDER);

RowLayout rowLayout = new RowLayout();
rowLayout.wrap=true;
rowLayout.pack=false;
rowLayout.type = SWT.WRAP;

tabFolder.setLayout(rowLayout);


for (int i=0; i<12; i++) {
TabItem item = new TabItem (tabFolder, SWT.NONE);
item.setText ("TabItem " + i);
Button button = new Button (tabFolder, SWT.PUSH);
button.setText ("Page " + i);
item.setControl (button);
}
tabFolder.setSize (400, 200);
shell.pack ();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch()) display.sleep ();
}
display.dispose ();
}
}

Topic: How can i save in JPG an applet java that allows to draw Previous Topic   Next Topic Topic: Biztalk problem

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use