SWT vs SWING

Anyone here can help me decide about what�s the better enivoronmente to develope low-consumption resource app, SWT or SWING.
I have some desktop ERP application developed with SWING but i have poor results (responsiveness talking).
Also we have here some old HW (32 MB RAM, Pentium) and it�s hard to run this app.
Can anyone here tall me where can i get some advices to improve it.
Thanks a lot, in advance.

SWT would be faster. For an example, check out the Eclipse Project.

Similar Messages

  • How to embed SWT to swings

    I have found information regarding how to embed Swings in SWT.
    But i have to embed Swt browser in swings
    Please see the links for examples:
    http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Bringupabrowser.htm
    http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/EmbedSwingandAWTinSWT.htm
    I have to show two browsers in same window which i have partially done by embeding swings in swt. but need the otherway.
    Here is that code:
    import java.awt.Color;
    import java.awt.Frame;
    import java.awt.Panel;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import javax.swing.JSeparator;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.awt.SWT_AWT;
    import org.eclipse.swt.browser.Browser;
    import org.eclipse.swt.browser.LocationEvent;
    import org.eclipse.swt.browser.LocationListener;
    import org.eclipse.swt.browser.ProgressEvent;
    import org.eclipse.swt.browser.ProgressListener;
    import org.eclipse.swt.browser.StatusTextEvent;
    import org.eclipse.swt.browser.StatusTextListener;
    import org.eclipse.swt.layout.GridData;
    import org.eclipse.swt.layout.GridLayout;
    import org.eclipse.swt.widgets.Composite;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Event;
    import org.eclipse.swt.widgets.Label;
    import org.eclipse.swt.widgets.Listener;
    import org.eclipse.swt.widgets.ProgressBar;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Text;
    import org.eclipse.swt.widgets.ToolBar;
    import org.eclipse.swt.widgets.ToolItem;
    import com.jgoodies.forms.layout.CellConstraints;
    import com.jgoodies.forms.layout.FormLayout;
    public class BringUpBrowser {
    public static void main(String[] args) {
         BringUpBrowser browser= new BringUpBrowser();
         browser.showBrowser();
    public void showBrowser(){
    Display display = new Display();
    final Shell shell = new Shell(display);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 3;
    shell.setLayout(gridLayout);
    shell.setMaximized(true);
    final Browser browser1 = new Browser(shell, SWT.NONE);
    GridData data1 = new GridData();
    data1.horizontalAlignment = GridData.FILL;
    data1.verticalAlignment = GridData.FILL;
    data1.horizontalSpan = 3;
    data1.grabExcessHorizontalSpace = true;
    data1.grabExcessVerticalSpace = true;
    browser1.setLayoutData(data1);
    browser1.setUrl("www.indussoftware.com");
    ToolBar toolbar = new ToolBar(shell, SWT.NONE);
    ToolItem itemBack = new ToolItem(toolbar, SWT.PUSH);
    itemBack.setText("Back");
    ToolItem itemForward = new ToolItem(toolbar, SWT.PUSH);
    itemForward.setText("Forward");
    ToolItem itemStop = new ToolItem(toolbar, SWT.PUSH);
    itemStop.setText("Stop");
    ToolItem itemRefresh = new ToolItem(toolbar, SWT.PUSH);
    itemRefresh.setText("Refresh");
    ToolItem itemGo = new ToolItem(toolbar, SWT.PUSH);
    itemGo.setText("Go");
    GridData data = new GridData();
    data.horizontalSpan = 3;
    toolbar.setLayoutData(data);
    Label labelAddress = new Label(shell, SWT.NONE);
    labelAddress.setText("Address");
    final Text location = new Text(shell, SWT.BORDER);
    data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.horizontalSpan = 2;
    data.grabExcessHorizontalSpace = true;
    location.setLayoutData(data);
    final Browser browser = new Browser(shell, SWT.NONE);
    data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.FILL;
    data.horizontalSpan = 3;
    data.grabExcessHorizontalSpace = true;
    data.grabExcessVerticalSpace = true;
    browser.setLayoutData(data);
    final Label status = new Label(shell, SWT.NONE);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    status.setLayoutData(data);
    final ProgressBar progressBar = new ProgressBar(shell, SWT.NONE);
    data = new GridData();
    data.horizontalAlignment = GridData.END;
    progressBar.setLayoutData(data);
    Composite composite = new Composite(shell, SWT.EMBEDDED);
    data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.CENTER;
    data.horizontalSpan = 3;
    composite.setLayoutData(data);
    Frame frame = SWT_AWT.new_Frame(composite);
    JPanel panel = new JPanel();
    panel.setLayout(new FormLayout("0:grow(0.4),0:grow(0.2),0:grow(0.4)","5dlu,5dlu,16dlu"));
    frame.add(panel);
    CellConstraints cc = new CellConstraints();
    JButton button = new JButton("Close");
    panel.add(new JSeparator(),cc.xyw(1, 1, 3));
    panel.add(button,cc.xy(2, 3));
    button.addActionListener(new ActionListener(){
              public void actionPerformed(ActionEvent e) {
                   //this = null;
    //end of chakri
    /* event handling */
    Listener listener = new Listener() {
    public void handleEvent(Event event) {
    ToolItem item = (ToolItem) event.widget;
    String string = item.getText();
    if (string.equals("Back"))
    browser.back();
    else if (string.equals("Forward"))
    browser.forward();
    else if (string.equals("Stop"))
    browser.stop();
    else if (string.equals("Refresh"))
    browser.refresh();
    else if (string.equals("Go"))
    browser.setUrl(location.getText());
    browser.addProgressListener(new ProgressListener() {
    public void changed(ProgressEvent event) {
    if (event.total == 0)
    return;
    int ratio = event.current * 100 / event.total;
    progressBar.setSelection(ratio);
    public void completed(ProgressEvent event) {
    progressBar.setSelection(0);
    browser.addStatusTextListener(new StatusTextListener() {
    public void changed(StatusTextEvent event) {
    status.setText(event.text);
    browser.addLocationListener(new LocationListener() {
    public void changed(LocationEvent event) {
    if (event.top)
    location.setText(event.location);
    public void changing(LocationEvent event) {
    itemBack.addListener(SWT.Selection, listener);
    itemForward.addListener(SWT.Selection, listener);
    itemStop.addListener(SWT.Selection, listener);
    itemRefresh.addListener(SWT.Selection, listener);
    itemGo.addListener(SWT.Selection, listener);
    location.addListener(SWT.DefaultSelection, new Listener() {
    public void handleEvent(Event e) {
    browser.setUrl(location.getText());
    shell.open();
    browser.setUrl("http://google.co.in");
    while (!shell.isDisposed()) {
    if (!display.readAndDispatch())
    display.sleep();
    display.dispose();
    Here Iam facing problems while adding Listeners.
    Can u help me in this?

    GANGINENI wrote:
    hi i developed a program for timer in applet, i want to include it in to jFrame, can some one help me,i am developing program in netbeansYes.
    1) ....
    h1. Edit:
    in light of camickr's note, I am deleting my post. The original poster is now on my DNH list and will remain there until his behavior changes.
    Edited by: Encephalopathic on Oct 31, 2008 2:20 PM

  • Should I compare SWT to Swing or AWT?

    I am currently doing my dissertation on ways to speed up a Java GUI. Obviously I am comparing the SWT (Eclipse project) to Swing and not really focusing on the AWT (Sun dont seem to be?!). I am interested in looking at how you could create a Swing interface that could compete with the speed of the SWT? I am also looking at the feature set of each and hopefully going to conclude, which is the better widget toolkit, for a highly performant GUI with respect to speed and features?
    Any facts (& opinions :-) would be more than welcome!
    - Simon

    I tried the "panel.paint(Canvas.getGraphics());". However, I still don't have anything printed. My code is as follows.
    JFrame frame = new JFrame("FrameDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setPreferredSize(new Dimension(300, 200));
    jp = new JPanel();
    jp.setPreferredSize(new Dimension(300, 200));
    gpc = MyPlotCanvas.createPlotCanvas();
    Canvas c = gpc.getGraphicsCanvas();
    jp.paint( c.getGraphics() );
    frame.add(jp);
    frame.setSize(600, 500);
    frame.show();

  • How to set a Swing component as Modal on a SWT Component?

    How to set a Swing component as Modal on a SWT Componen?.I mean, I have a SWt Component window and from that window I am displaying a SWING Component Modal window.
    The problem is my swing window is not working as Modal always.
    When I opened the swing window from SWT window,swing window is working as Modal.But if Idouble click on Menubar or Title bar of the SWT Window then my Swing window goes back.If I click on any other part of the SWT window.. then once again Swing window is working as modal.
    Can any one suggest me to solve this?
    I think this is isuue related with Swing over SWT..

    pradeep.rajadurai wrote:
    I want set the JTable as a background of jframe or jinternalframe , how it is possible One way that may work, you can always extract the image from a rendered JTable and then paint the same image into the JPanel that holds your components via it's paintComponent method, then added the JPanel to the app's contentPane.
    give me simple pgmIs English your second language? Because if so, please understand that this demand can be taken by some as rude.

  • Using swing and swt together

    i would like to use some of the components of swt such labels or buttons in swing as swt has better look and feel. but in all the examples i found they are using a whole set of swt api to create frames and showing them up.
    Isnt there any way to add button or label of SWT in Swing. i found a method SWT_AWT.newFrame(). But it is returning a awt frame not a Swing JFrame that at the frame level. i need them at individual component level(buttons and labels).
    hope u understood my problem.. any other suggestions??

    Swing and SWT are two different framework. Usually, peoiple choose one and stick with it. I would not mess with mixing SWT with Swing or vice-versa. I really don't understand why you would choose to mix these two framework together. "better look and feel" is not the best answer for this. what i would look into is a look and feel for Java (like JGoodies look n feel)..and check for Swing component that pther people have made (or enhance upon the Swing library).
    Stick with one framework. Your life will be much easier.
    Futhermore, maintainance would be less difficult. (you only have to know one framework instead of two, plus how they interact)

  • Best way for gui programming? swing awt jfc swt ....

    hi,
    i have been programming java for some time but exclusively for web, servlets, jsp etc..
    but now i have to do some �real� gui�s. I have no gui experience , (ok I did some basic examples just to see how things work) but/and I�m not able to determine which way I should go.
    So I did some google search and read some threads here im forum on topics swing vs. awt (or so) and found lot of topics with lot of different opinions(some of them also a little bit out of date) so now im CONFUSED more then ever.
    I read people asking questions like :what is better awt or swing and then getting the perfect technical answers like :
    AWT components are NOT native components. AWT components are Java objects. Particular instances of AWT componets (Button, Label, etc.) MAY use peers to handle the rendering and event handling. Those peers do NOT have to be native components. And AWT components are NOT required to use peers for themselves at all.
    Or
    There are some significant differences between lightweight and heavyweight components. And, since all AWT components are heavyweight and all Swing components are lightweight (except for the top-level ones: JWindow, JFrame, JDialog, and JApplet), these differences become painfully apparent when you start mixing Swing components with AWT components.
    But I don�t care that much(at least not now) about this detail answers.
    I would simply like to know from some experienced gui guru, (due to the fact that we have 2005 and java 1.5) if u would like to learn gui in java quickly and know everything u know now which way would u choose:
    AWT
    JFC
    SWING
    SWT
    And which IDE would u use.
    I simply want to get quickly started and do some basic gui programming ,nothing special, but I would like to avoid that after weeks of doing one, then find out the was the wrong one and again learn the another one.
    TIA Nermin

    try swt vs swing and see what you think, its not really a decision someone else can make for you. as long as you don't try and mix the two, it should be a similar learning curve either way.

  • How to Converting SWT application  to Swing jdialog?

    How hard is to convert an exising dialog writen in Eclipse SWT to Swing
    import java.io.*;
    import java.util.Enumeration;
    import java.util.Hashtable;
    import javax.swing.*;
    import java.awt.*;
    import my.base.Action;
    import my.base.ActionQueue;
    import my.base.Location;
    import my.base.Task;
    import my.base.TaskTree;
    import my.buffer.BlockBuffer;
    import my.fs.File;
    import my.impl.FillBufferActionQueue;
    //import org.apache.log4j.Logger;
    import org.eclipse.swt.SWT;
    import org.eclipse.swt.events.MouseAdapter;
    import org.eclipse.swt.events.MouseEvent;
    import org.eclipse.swt.events.SelectionAdapter;
    import org.eclipse.swt.events.SelectionEvent;
    import org.eclipse.swt.events.SelectionListener;
    import org.eclipse.swt.graphics.GC;
    import org.eclipse.swt.graphics.Image;
    import org.eclipse.swt.graphics.ImageData;
    import org.eclipse.swt.graphics.PaletteData;
    import org.eclipse.swt.graphics.RGB;
    import org.eclipse.swt.graphics.Rectangle;
    import org.eclipse.swt.layout.GridData;
    import org.eclipse.swt.layout.GridLayout;
    import org.eclipse.swt.widgets.Button;
    import org.eclipse.swt.widgets.Composite;
    import org.eclipse.swt.widgets.Display;
    import org.eclipse.swt.widgets.Menu;
    import org.eclipse.swt.widgets.MenuItem;
    import org.eclipse.swt.widgets.Shell;
    import org.eclipse.swt.widgets.Table;
    import org.eclipse.swt.widgets.TableColumn;
    import org.eclipse.swt.widgets.TableItem;
    public class SynchLogWindow extends org.eclipse.swt.widgets.Composite {
    private Button buttonGo;
    private TableColumn tableColumn1;
    private TableColumn tableColumnDestination;
    private TableColumn tableColumnAction;
    private TableColumn tableColumnSource;
    private TableColumn tableColumnExplanation;
    private Table tableLogLines;
    private Hashtable actionImages;
    private Image locationSource;
    private Image locationDestination;
    private Image locationBoth;
    private Image nodeFile;
    private Image nodeDirectory;
    private TaskTree taskTree;
    public SynchLogWindow(Composite parent, int style)
    super(parent, style);
    initGUI();
    initializeImages();
    * Initializes the GUI.
    * Auto-generated code - any changes you make will disappear.
    public void initGUI(){
    try {
    preInitGUI();
    tableLogLines = new Table(this,SWT.FULL_SELECTION);
    tableColumn1 = new TableColumn(tableLogLines,SWT.NULL);
    tableColumnExplanation = new TableColumn(tableLogLines,SWT.NULL);
    tableColumnSource = new TableColumn(tableLogLines,SWT.NULL);
    tableColumnAction = new TableColumn(tableLogLines,SWT.NULL);
    tableColumnDestination = new TableColumn(tableLogLines,SWT.NULL);
    buttonGo = new Button(this,SWT.PUSH| SWT.CENTER);
    this.setSize(new org.eclipse.swt.graphics.Point(711,225));
    GridData tableLogLinesLData = new GridData();
    tableLogLinesLData.verticalAlignment = GridData.FILL;
    tableLogLinesLData.horizontalAlignment = GridData.FILL;
    tableLogLinesLData.widthHint = -1;
    tableLogLinesLData.heightHint = -1;
    tableLogLinesLData.horizontalIndent = 0;
    tableLogLinesLData.horizontalSpan = 1;
    tableLogLinesLData.verticalSpan = 1;
    tableLogLinesLData.grabExcessHorizontalSpace = true;
    tableLogLinesLData.grabExcessVerticalSpace = true;
    tableLogLines.setLayoutData(tableLogLinesLData);
    tableLogLines.setHeaderVisible(true);
    tableLogLines.setLinesVisible(true);
    tableLogLines.setSize(new org.eclipse.swt.graphics.Point(690,179));
    tableLogLines.addMouseListener( new MouseAdapter() {
    public void mouseUp(MouseEvent evt) {
    tableLogLinesMouseUp(evt);
    tableColumn1.setResizable(false);
    tableColumn1.setText("tableColumn1");
    tableColumnExplanation.setText("Explanation");
    tableColumnExplanation.setWidth(150);
    tableColumnSource.setText("Source");
    tableColumnSource.setWidth(220);
    tableColumnAction.setResizable(false);
    tableColumnAction.setText("Action");
    tableColumnAction.setWidth(50);
    tableColumnDestination.setText("Destination");
    tableColumnDestination.setWidth(220);
    GridData buttonGoLData = new GridData();
    buttonGoLData.verticalAlignment = GridData.CENTER;
    buttonGoLData.horizontalAlignment = GridData.END;
    buttonGoLData.widthHint = -1;
    buttonGoLData.heightHint = -1;
    buttonGoLData.horizontalIndent = 0;
    buttonGoLData.horizontalSpan = 1;
    buttonGoLData.verticalSpan = 1;
    buttonGoLData.grabExcessHorizontalSpace = false;
    buttonGoLData.grabExcessVerticalSpace = false;
    buttonGo.setLayoutData(buttonGoLData);
    buttonGo.setText("Go");
    buttonGo.addSelectionListener( new SelectionAdapter() {
    public void widgetSelected(SelectionEvent evt) {
    buttonGoWidgetSelected(evt);
    GridLayout thisLayout = new GridLayout(1, true);
    this.setLayout(thisLayout);
    thisLayout.marginWidth = 2;
    thisLayout.marginHeight = 2;
    thisLayout.numColumns = 1;
    thisLayout.makeColumnsEqualWidth = false;
    thisLayout.horizontalSpacing = 2;
    thisLayout.verticalSpacing = 2;
    this.layout();
    postInitGUI();
    } catch (Exception e) {
    e.printStackTrace();
    /** Add your pre-init code in here      */
    public void preInitGUI(){
    /** Add your post-init code in here      */
    public void postInitGUI(){
    public static void show( final TaskTree task )
    final Display display = Display.getDefault();
    display.syncExec( new Runnable() {
    public void run()
    try {
    Shell shell = new Shell(display);
    SynchLogWindow inst = new SynchLogWindow(shell, SWT.NULL);
    inst.setTaskTree( task );
    inst.rebuildActionList();
    shell.setLayout(new org.eclipse.swt.layout.FillLayout());
    Rectangle shellBounds = shell.computeTrim(0,0,663,225);
    shell.setSize(shellBounds.width, shellBounds.height);
    shell.setText( "Synchronization Actions" );
    shell.setImage( new Image( null, "images/Location_Both.gif" ) );
    shell.open();
    } catch( Exception ex ) {
    ex.printStackTrace();
    public void setTaskTree( TaskTree task )
    this.taskTree = task;
    public static Image loadImage( String filename )
    try {
    //System.out.println("crrent path:"+System.getProperty("user.dir"));
    return new Image( null, new FileInputStream( "images/"+filename) );
    } catch( FileNotFoundException e ) {
    e.printStackTrace();
    return null;
    public void initializeImages()
    nodeFile = loadImage( "Node_File.gif" );
    nodeDirectory = loadImage( "Node_Directory.gif" );
    locationSource = loadImage( "Location_Source.gif" );
    locationDestination = loadImage( "Location_Destination.gif" );
    locationBoth = loadImage( "Location_Both.gif" );
    actionImages = new Hashtable();
    for( int i = 0; i < Action.names.length; i++ )
    actionImages.put( new Integer( i ), loadImage( "Action_"+Action.names[i]+".gif" ) );
    for( int i = 0; i < Action.errorNames.length; i++ )
    actionImages.put( new Integer( i+10 ), loadImage( "Action_"+Action.errorNames[i]+".gif" ) );
    protected void drawSide( GC g, Task t, Action a, int location )
    File n = location==Location.Source?t.getSource():t.getDestination();
    int x = location==Location.Source?2:2*16+2;
    if( n.exists() )
    if( n.isDirectory() )
    g.drawImage( nodeDirectory, x, 0 );
    else g.drawImage( nodeFile, x, 0 );
    // TODO draw some not-existing image ?
    if( (a.getLocation() & location) > 0 )
    Image actionImage = (Image)actionImages.get( new Integer( a.getType() ) );
    if( actionImage != null )
    g.drawImage( actionImage, x, 0 );
    if( location == Location.Source )
    g.drawImage( locationSource, x+16, 0 );
    else g.drawImage( locationDestination, x-16, 0 );
    protected void drawLocation( GC g, Action a )
    switch( a.getLocation() )
    case Location.Source:
    g.drawImage( locationSource, 16+2, 0 );
    break;
    case Location.Destination:
    g.drawImage( locationDestination, 16+2, 0 );
    break;
    case Location.Both:
    g.drawImage( locationBoth, 16+2, 0 );
    break;
    protected Image buildTaskImage( Task t, Action a )
    ImageData data = new ImageData( 16*3+2, 16, 8, new PaletteData( 0, 0, 0 ) );
    data.transparentPixel = data.palette.getPixel( new RGB( 0, 0, 0 ) );
    Image image = new Image( null, data );
    GC g = new GC(image);
    drawSide( g, t, a, Location.Source );
    drawSide( g, t, a, Location.Destination );
    drawLocation( g, a );
    g.dispose();
    return image;
    protected Image buildTaskImage( Task t )
    return buildTaskImage( t, t.getCurrentAction() );
    protected void addTaskChildren( Task t )
    for( Enumeration e = t.getChildren(); e.hasMoreElements(); )
    addTask( (Task)e.nextElement() );
    protected void addTask( Task t )
    if( !t.getCurrentAction().isBeforeRecursion() )
    addTaskChildren( t );
    Image image = buildTaskImage( t );
    TableItem item = new TableItem( tableLogLines, SWT.NULL );
    item.setImage( 3, image );
    item.setText( new String[] {
    t.getCurrentAction().getExplanation(),
    t.getSource().getPath(),
    t.getDestination().getPath()
    item.setData( t );
    if( t.getCurrentAction().isBeforeRecursion() )
    addTaskChildren( t );
    public void rebuildActionList()
    tableLogLines.clearAll();
    tableLogLines.setItemCount(0);
    addTaskChildren( taskTree.getRoot() );
    //tableLogLines.redraw();
    protected void showPopup( int x, int y )
    System.out.println( "Contextmenu at: "+x+", "+y );
    SelectionListener selListener = new SelectionAdapter() {
    public void widgetSelected( SelectionEvent e )
    Integer i = (Integer)e.widget.getData();
    TableItem item = tableLogLines.getSelection()[0];
    ((Task)item.getData()).setCurrentAction( i.intValue() );
    item.setImage( 3, image );
    item.setText( 1, action.getExplanation() );
    item.setData( action );
    tableLogLines.redraw();
    int top = tableLogLines.getTopIndex();
    rebuildActionList();
    tableLogLines.setTopIndex( top );
    TableItem[] items = tableLogLines.getSelection();
    if( items.length == 0 )
    return;
    Task t = (Task)items[0].getData();
    Menu m = new Menu( this );
    MenuItem mi;
    int curr = t.getCurrentActionIndex();
    Action[] actions = t.getActions();
    for( int i = 0; i < actions.length; i++ )
    if( i == curr )
    continue;
    Action al = actions;
    Image image = buildTaskImage( t, al );
    mi = new MenuItem( m, SWT.NULL );
    mi.setImage( image );
    mi.setText( Action.toString( al.getType() )+" - "+al.getExplanation() );
    mi.setData( new Integer( i ) );
    mi.addSelectionListener( selListener );
    Action al = new Action( Action.Nothing, Location.None, "Ignore" );
    Image image = buildTaskImage( t, al );
    mi = new MenuItem( m, SWT.NULL );
    mi.setImage( image );
    mi.setText( "Ignore" );
    mi.setData( al );
    mi.addSelectionListener( selListener );
    m.setLocation( toDisplay( x, y ) );
    m.setVisible( true );
    protected void performActions()
    try {
    //Logger logger = Logger.getRootLogger();
    //logger.addAppender( new FileAppender( new PatternLayout( "%d{ISO8601} [%p] %c %x - %m%n" ), "log/log.txt" ) );
    // Logger logger = Logger.getLogger( "FullSync" );
    // logger.info( "Synchronizing "+taskTree.getSource().getUri().toString()+" and "+taskTree.getDestination().getUri().toString() );
    // BlockBuffer buffer = new BlockBuffer( logger );
    // buffer.load();
    // ActionQueue queue = new FillBufferActionQueue(buffer);
    TableItem[] items = tableLogLines.getItems();
    for( int i = 0; i < items.length; i++ )
    Task t = (Task)items[i].getData();
    // queue.enqueue( t.getCurrentAction(), t.getSource(), t.getDestination() );
    // queue.flush();
    // buffer.unload();
    taskTree.getSource().flush();
    taskTree.getDestination().flush();
    taskTree.getSource().close();
    taskTree.getDestination().close();
    // logger.info( "finished synchronization" );
    } catch( IOException e ) {
    e.printStackTrace();
    /** Auto-generated event handler method */
    protected void tableLogLinesMouseUp(MouseEvent evt)
    if( evt.button == 3 )
    showPopup( evt.x, evt.y );
    /** Auto-generated event handler method */
    protected void buttonGoWidgetSelected(SelectionEvent evt)
    performActions();
    getShell().dispose();

    Give it a try and let us know.

  • Why is swing so slow ? :(

    Why java don't use native code for creating UI ?
    Any application, writen in swing is SLOW ...
    compared with .NET for example...
    even well tuned examples a too slow for using.
    I like java, but this $#%ing swing kills all GUI applications.

    The sad truth is that Swing has got such a bad wrap
    that many flock to SWT thinking its the holy grail of
    Java UI development because Swing is so bad. Nothing
    could be further than the truth. SWT is great in many
    respects, but Swing is better in many respects as
    well. If done right, Swing beats SWT in most cases.
    With JDK 1.4.2 improvements are even better, and on
    Mac OS X, Apple works with Sun to build their own
    optimized JVM, so Swing is pretty darn fast, near
    native performance on Mac OS X.
    I wish there was a faster way to get the truth about
    Swing out there. One problem, a lot of developers are
    not the types to accept that they wrote crappy code
    and thus their slow Swing performance is a direct
    result of their bad coding. It's a shame really.
    Accepting that you wrote some crap code only helps you
    get better...well, unless you really do stink at
    programming, then a career change may be in order ;)Well, this about wraps up my feelings about SWT and Swing.
    The problem with many programmers is: they don't like to read.
    Unfortunately Swing is too complex to write a decent program without a concerted effort in reading at a minimum the online tutorials, but to become professional you need a good Swing book.
    Once you get the hang of Swing it is actually better than Visual Basic or MS Access. I have written code generators for MS Access and Ms SQL Server applications. But I like Swing better for many reasons. For example a VB GUI is static, while with Swing you can create a form on the fly. I can go on for a couple of pages of why Swing is so cool, but I simple want to state that statements about Swing should be based on facts, not on some hype.
    Of course Swing can be made easier. That is why Sun is building a product like Rave.
    Swing is here to stay. Within just a couple of years more and more VB programmers will be coding Swing.
    This is good for Swing for the IT industry as a whole, becuase it will mean an explosion in quality products for the consumer market.

  • ESWT now or Swing soon

    Hi All,
    I'm looking to write a Java app for Windows Mobile 5.0 and have settled on CDC and IBM's j9 VM
    When it comes to the GUI though, I can't decide which route to take. AWT is simply not good enough as it does not have a Table class among other things.
    So, it seems like my options are using eSWT which is available now or Swing which will be available some time in the future through JSR 209.
    Since my desktop components are all done with Swign, this would be my first preference. The dilema though is that I need to start working on the PDA component now and can't wait for the finalization of JSR 209.
    Would it be possible to start a Swing app for Pocket PC now even though the JSR is not final? The website seems to say that PP 1.1 is required which IBM does have a 1.1 PP VM in version 6.1 of WEME.
    What else would be needed? Also if anyone thinks eSWT would be the better route, I'd love to hear it.
    Thanks in advance,
    Jim

    It is by no means guaranteed that even if JSR209 does release soon, than IBM sill put in into WAME. Last time I looked IBM voted against JSR209 on www.jcp.org. I think they may prefer to promote SWT over swing.

  • Offline Form Entry?

    All,
    I am looking for a solution that will allow users to fill-in form data offline that will can subsequently be posted to a Servlet when the user is on-line. There are not too many requirements to deal with:
    The off-line form should be able to duplicate a paper form (say, an application for a service)
    Both on-line and off-line versions should allow a user to enter data on the form directly
    When on-line, the form should be able to post form data to a ServletRight now, I know that Oracle Forms is a solution for this. Are there any others? I could think of dummying up a SWT or Swing UI that users could download that would resemble a form. However, that seems like a painful road to go down (@$#! one pixel off again). Any other ideas?
    Many thanks,
    Saish

    My father is still waiting for college to pay off.I tried to get money from my teachers, too, but they
    won't give anything. "See, this is me, what have you
    done!" I said. "Donate, it's all your fault!" Forget
    it.Memories of former high school teachers dancing in my head. <shudder/>
    - Saish

  • How to get start CDC with Windows Mobile 5

    i have bought new PDA (imate K-JAM) and want to develop CDC on it but i don't know what i need for develop it
    i found this site (http://home.elka.pw.edu.pl/~pboetzel/) i need to download all require software ? if no please tell me what i need to download ?
    thank you!!
    Message was edited by:
    ekkapop

    Hi ekkapop,
    First you need to find a JVM that support CDC, here are 2 of them for Pocket PC:
    -IBM J9
    -Creme
    Then choose the IDE of your preference (Eclipse, Netbeans...)
    I order to keep the best compability use only AWT components and compile with javac 1.4 or lower and jar your project.
    It should run just fine on thoses JVMs.
    Now this is the way to keep simple, then you can try adding swt or swing libraries to enrich your project and try other packs for IDE.
    But using awt components and compiling with javac 1.4 have worked just fine for me.
    Now I am also beggining with the J2ME so this is just the first feedback I can give for now.
    Regards,
    Romain

  • Unicode Character Map

    Hi-ya
    I want to craate a unicode character map much like the one in windows. You choose a font and it shows you all the characters.
    First of all I would have thought this would exist, either with swing or java but I can't find it. Has anyone seen one in the wild?
    Secondly how would the iteration alogrithmn look like?
    I found some samples at unicode.org but they seem way oversized for what I want to do. This is the applet from unicode that I am talking about:
    http://www.unicode.org/reports/tr15/Normalizer.html
    Is there no easy - peasy way to go through all the unicode code points in a font? Like I said either in swt or swing.
    thanks.

    You haven't seen the Font2DTest demo program?
    It doesn't seem to be online but you will find if you look under the demo/jfc/Font2DTest directory of your copy of the java virtual machine.

  • Close Window Button

    I have made a "close" button. My close button is supposed to close the window and open another one. How can I do this? Here is my code:
    btnExit.addSelectionListener(new SelectionAdapter() {
         public void widgetSelected(final SelectionEvent arg0)
              doClose();
    shell.addDisposeListener(new DisposeListener() {
         public void widgetDisposed(final DisposeEvent arg0) {
              doClose();
    private void doClose() {
         shell.dispose();
         new MainWindow();
    }When I use the "X" button in the window's top-right corner, the window closes properly and everything is good. However, when I close the window using my Close button, the window does not close properly. I'm assuming it's because I call new MainWindow() after shell.dispose(). But if I call new MainWindow() before shell.dispose() my window will never close.
    Any help?
    btw, I am using SWT not Swing but I don't think this is an SWT specific issue (plus there don't seem to be any swt help forums anywhere)

    SelectionListener is basically ActionListener in SWT. The doClose() method is being invoked by both listeners. So that's not the problem.
    I'm basically curious how I can close the current (and only) window/shell and then open another window (as my first post indicates). The code would be the same for Swing as for SWT, so Swing code would be fine.

  • Plugin for eclipse

    hi
    i have a swing application.I want to make it as a plugin to eclipse.suggest some way for it and examples if any.
    Requirement is i will get that jar of swing aaplication and want to make a plugin out of it.
    Thanks

    And why are you not asking this on the Eclipse forums?
    Note that Eclipse uses SWT, not Swing. Your requirement is likely not going to happen without swapping out the GUI API.

  • Order Perspectives

    Hello Everyone,
    We have added the canned 'Custom Search' portlet to our site and it works really good. An enhancement that we would like to make though is:
    When you click the perspective icon in the seach window, the perspectives window pops up. This window is divided in to 2 regions, avalable perspectives (left) and selected perspectives (right). We would like to re-order the perspectives that come up in the left window. It seems as if they are sorted by ID currently. How could we sort them by date or alpha-numerically?
    This seems to be a very big issue for our user group and we are thinking we may have to re-write the custom search app if we cant find out how to do this. Please help :-).
    Cheers,
    Cory

    "xy" <[email protected]> wrote in message
    news:duqijr$m6r$[email protected]..
    >> o Enhanced SWT support
    >> - Support for alignment to any control in FormLayout
    >> - Enhanced attachment feedback in FormLayout
    >> - Support for custom SWT property editors
    >> - Support for cross-parent alignment for SWT absolute layout
    >> o Enhanced JFace & RCP support
    >> - Support for SectionParts
    >> - Support for properties of buttons on JFace Dialogs
    >> - Support for "parent" argument of
    >> ViewPart.createPartControl(Composite parent)
    >> - Support for custom FormToolkit's
    >
    > Shall I use JFace or SWT? JFace maybe a better choice, but SWT is better
    > supported in "SWT Designer, Swing Designer & WindowBuilder Pro".
    I don't understand the question. It isn't an issue of using one or the
    other. You can use both together if you like.
    SWT Designer has excellent support for the creation and editing of all
    common SWT, JFace and RCP components.
    -Eric Clayberg
    Sr. Vice President of Product Development
    Instantiations, Inc.
    http://www.instantiations.com
    http://www.windowbuilderpro.com/
    Author: "Eclipse: Building Commercial Quality Plug-ins"
    http://www.awprofessional.com/title/0321228472

Maybe you are looking for