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.

Similar Messages

  • How to convert an Application Service into a Web Service

    Hi,
    I am working on SAP Netweaver CE 7.1. I have created an Application Service which returns an output as a List with each elemnt of the list conatining some attributes and a List.
    now I want to convert this AS into a Web Service. how I can do that as teh Developer Studio doesn't allow me to select the method which returns the List.
    Also how should I deploy the Web Service and test the same.
    Please reply ASAP.
    Manish

    To convert your Application Service into a Web Service ,
    1) go to General Tab of your Application Service
    2) check the option Remote Enabled Service , Save Metadata
    3) Right click Application Service and select  WebService New , give name for your Webservice and select Default Configuration type : Simple SOAP or select Basic Auth SOAP if u want your webservice to be password protected , just click next and finally finish
    4) Genearte your project code , build and deploy your application
    5) Then goto webService navigator to test your Web service
    Hope this helps
    Thanks
    Asif

  • How to convert WAR application to be able to deploy it with JSPM and SDM?

    We have to be able to deploy an application packaged in WAR file usign the JSPM and SDM GUI tools.
    Using the Deploy tool there are no problems to build EAR file from the WAR and deploy it successfully to tha Application Server.
    How should we convert our WAR application, or the EAR file created with the DeployTool in order to be able to use these 2 tools?
    Using that EAR file with the JSPM and SDM GUI tools doesn't work:
    JSPM
    The ear file is copied in the inbox directory, but there is the following message:
    No applicable support package stack(s) found for deployment in inbox directory
    server\sapmnt\trans\EPS\in
    SDM GUI:
    When providing the EAR file created with the DeployTool, the SDM GUI fails to add it:
    com.sap.sdm.util.sduread.IllFormattedSduFileException: The information about the development component found in the manifest is either missing or incomplete!
    Manifest attributes are missing or have badly formatted value:
    attribute keylocation is missing
    attribute keyname is missing
    attribute keyvendor is missing
    attribute keycounter is missing
    After adding these attributes, we couldn't manage to provide valid manifest header.
    How can we modify/create valid manifest in order to be able to use the SDM GUI tool?
    Please, give us directions how to convert our WAR package in order to use these tools?

    Hi Sam
    Check out the below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/1b/92e4e701b242c2833a7adde6ecad09/frameset.htm
    If you have an already built war file then most probably the easiest way to assemble it and deploy it will be to use the deploy tool (http://help.sap.com/saphelp_nw04/helpdata/en/35/e3ee3da7138e5be10000000a114084/frameset.htm) Usually we use the NetWeaver Developer Studio to build and deploy J2EE Applications (http://help.sap.com/saphelp_nw04/helpdata/en/fe/a3996fa314f94f8a0c3475b08636d0/frameset.htm).
    OR
    As i understand you the source files arent available so rebuilding is out of question.
    0. Add web-j2ee-engine.xml in the same path as web.xml
    <web-j2ee-engine>
    <login-module-configuration/>
    </web-j2ee-engine>
    1. Create a Dummy EAR file.
    2. Add the WAR file to the base directory (path should be blank if you view the EAR in WinZip).
    3. Open the application.xml and add the entry for the WAR file
    <application id="Application_ID">
    <display-name>EAR_Name</display-name>
    <module id="WebModule_1127381405488">
    <web>
    <web-uri><WAR NAME>.war</web-uri>
    <context-root>sampleContextRoot</context-root>
    </web>
    </module>
    </application>
    Note: The number in module id has some significance, for the time being you have any random number.
    Deploy the EAR.
    Reward points if usefull

  • How to convert WebDynpro Application into Webservoce

    HI Experts,
    I have one WebDynpro Application which has the functionality of search Using KM Index Management API's.
    This performs the search in portal using TREX.
    My requirement is to use this functionality in sharepoint portal(Microsoft Product).
    From this sharepoint portal they want to use this search application to search in portal.
    Now my choice is to convert this WebDynpro application into webservice so that , share point server guys can call webservice to use that search application.
    How can I Convert my webdynpro application into webservice?
    Any other ideas?
    Thanks in advance
    Regards
    Bala
    which needs to be converted into

    Hi Bala,
             I think there is no possibility as for your query. You will be allowed to create a webservice which is a piece of code that can be applicable to required application. Gothrough the following link to know clear details about webservice.  
    http://help.sap.com/saphelp_nw04/helpdata/en/84/54953fc405330ee10000000a114084/content.htm
    download.microsoft.com/download/f/3/7/f371bbba-2341-41bf-822d-2c7dd4174756/UI_CreateWebServices_5min.ppt
    Regards,
    Harish

  • How to convert batch application to server app?

    I have an application that performs some processing task in batch mode: data in, processing, data out. The application can be accessed through a well-documented API but is not thread-safe -- one cannot run the processing function in two threads concurrently.
    In order to make that processing accessible to a program written in another language I would like to encapsulate it into some form of server.
    I would like to find some minimum overhead solution where the other program sends the data to the server app in some way, waits for the processing to complete and reads back the result. One option would be to use the HTTP protocol with a POST request, another to write the data to a database row and send some command over a socket.
    My main problem is: which solution is the easiest to implement and use and the one that allows to serialize the processing with the least effort. The solution should make it easy to prevent deadlocks or similar nuisances.
    Are there some standard patterns for doing this or what would you Wizards recommend?

    Thanks for the answers!
    I must admit that I am still rather clueless in general about the issues involved here.
    My immediate need is to send text files to the java application and get back processed text files. At the moment I have to do this from perl, but in the future, other languages (mostly scripting languages) might also need to do this.
    So what I am trying to achieve is this: the client should be able to access the Java application/service as if it was some synchronous write/read operation (similar to a HTTP post request waiting for a response). There might be several clients working in that way but the the server should make sure that they get cleanly serialised: only one text file can be processed at any one time because the API is not thread safe.
    I also cannot change the API itself -- just wrap into something that will do what I described. The more lightweight,easy to use, and easy to implement the solution the better.
    For example, is there some kind of mini HTTP server and some serialization mechanism in Java that would make it possible to run the Java application disguised as a web service? Are there disadvantages to this and other solutions that are more suited?
    I have looked at JMS and it does make a bit of a heavyweight impression to me. Also I'd prefer a solution where the clients use some mechanism that is more general, e.g. HTTP or the file system or maybe even a RDBS table (not sure what the possible traps with regards to deadlocks, timeouts etc. are there).

  • Convert my application into a demo version

    how to convert my application built using D2K and back end oracle into a demo version so that i can give it to others for use for a certain period of time.
    They should not be able to use my application after the period even if they change their system date to a previous date.

    Web enable your application and give the customers a URL that they can access. After a certain time just drop the URL.
    To learn how to upgrade Forms applications to the Web: http://otn.oracle.com/formsupgrade

  • How to convert a .jad file to .class file in JAVA Swings.

    Hi all,
    Sorry for the interruption.I am also facing the same problem.I am using DEJDecompiler.But my application is not J2ME But J2EE.( a Swing application).I opened .class file and made some changes but I dont know how to convert into a .class file again.
    I tried saving .jad file to .java file.Then it is showing lot of errors in Eclipse Platform.I doubt if there are any errors in the .class file already,then how could the program would run.I put all the programs in the respective platforms only and then testing.It fails.
    (2) one more question,is if I do not need to disturb any existing coding and need to create a seperate java file which will do my customisation,then what should I do.I could not get any interfaces in the program.
    Please help me as the matter is most urgent.
    Thanks in advance
    With regds
    Satheesh.K

    I tried saving .jad file to .java file.Then it is
    showing lot of errors in Eclipse Platform.I doubt if
    there are any errors in the .class file already,then
    how could the program would run.I put all the programs
    in the respective platforms only and then testing.It
    fails.So who's Java program/library are you trying to steal?
    (2) one more question,is if I do not need to disturb
    any existing coding and need to create a seperate java
    file which will do my customisation,then what should I
    do.I could not get any interfaces in the program.
    Please help me as the matter is most urgent.Wow, you urgently need to steal someones program/library. The best person to give you advice urgently is the owner of the program/library you are trying to steal.
    Thanks in advancePlease don't thank me because I'm not going to help you!
    With regds
    Satheesh.K

  • How to convert oracle form fmb file to java swing file using Jdeveloper

    how to convert oracle form fmb file to java swing file using Jdeveloper.Please explain with detailes steps if possible or please give a link where it is available
    thanks
    Message was edited by:
    user591884

    There is no automatic way to do this in JDeveloper. I know there are some Oracle Partners offering forms to java conversion, I don't know how much of their tools are automated and done with JDeveloper. With JDeveloper+ADF you basically rewriting the Forms application from scratch (and using ADF is helpful during this process).

  • How can I create a Report from a SWT-Application?

    Post Author: mkoch
    CA Forum: JAVA
    I'm a Developer and new to Crystal Reports and I have the job to create a Report from a SWT-Application.The report-files ( *.rpt) were created with Crystal Reports 10 or 11.> I'm not sure but I have access to a machine where Crystal Reports 10 Developer an Crystal Reports 11 Runtime are installed.Can anybody describe in detail how I can start the creation of a report from my Java-Application?> What libraries are needed, where can I get them and so on.I saw in the CR10-Setup that there is a Java-feature - but unfortunately this is not installed on my test-machine.--> Is it necessary to install this feature or can I get this files on businessobjects.com?Is it possible to start the report-creation from command-line?I saw a Java-example on the internet which uses Report.exe - but I haven't found this on my machine.I hope, that somebody can help me.GreetingsMarkus

    Inv. #
    Item
    Sale Price
    Lisa
    Oct Sold 12
    Oct Sold 12-2
    Oct Sold 12-3
    149
    Vase Lidded
    25
    201
    Bird
    7
    7
    202
    Bird
    7
    203
    Bird
    7
    204
    Bird
    7
    7
    205
    Bird
    7
    7
    206
    Bird
    7
    7
    207
    Bird
    7
    207
    Bird
    7
    7
    208
    Bird
    7
    7
    209
    Bird
    7
    7
    This is my very simple inventory.  On previous program I could sort by those items that did not have any figure in the row across.  Then I could print a report of open inventory.  Such as 149 Lidded Vase has not sales amount in the four colums across, thus it is open inventory.  How can I capture all those items in one report?

  • 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

  • How to convert an existing db application into a clustered application

    Hi,
    I want to know how can i convert my application into a clustered application.
    my current application there are 5 modules and thses modules have 5-10 tables in common.Since these modules work simultaeously the processing time gets increased drastically.Is it possible that to have seperate instances of these tables and every module works independently and oracle take care of the consistency.
    I want to know if RAC could be the solution?

    user8731258 wrote:
    Hi,
    I want to know how can i convert my application into a clustered application.
    my current application there are 5 modules and thses modules have 5-10 tables in common.Since these modules work simultaeously the processing time gets increased drastically.Is it possible that to have seperate instances of these tables and every module works independently and oracle take care of the consistency.
    I want to know if RAC could be the solution?Sounds like an application design issue. I think you'd be best served tracing the applications and see where the overhead is being introduced when they do their process concurrently.
    Throwing RAC at a poorly developed application would do nothing except amplify the poor design (it'll make things worse).
    Cheers,

  • HOW TO CONVERT A XML FILE TO HTML FILE FORMAT IN WINDOWS APPLICATION

    Hi iam a fresher iam working on a project in that i should convert the data in xml file to html file. I dont have any idea regarding this can anyone help me how to convert the xml file to a html file format. I just written the code till how to read the xml
    file. Now i stucked how to write the code for converting to html format.
    Thanks and Regards,
    Dileep.

    Hi iam a fresher iam working on a project in that i should convert the data in xml file to html file. I dont have any idea regarding this can anyone help me how to convert the xml file to a html file format. I just written the code till how to read the xml
    file. Now i stucked how to write the code for converting to html format.
    Thanks and Regards,
    Dileep.
    Hello,
    For converting xml file to html, we could refer to the way shared in the following thread which uses an XSLT stylesheet to transform the XML into another format using the
    XslTransform class.
    http://www.codeproject.com/Articles/12047/How-to-Convert-XML-Files-to-HTML
    Regards.
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I have purchased the Adobe program that allows you to convert PDF documents. How do use the application?. Thanks for your help.

    I have purchased the Adobe program that allows you to convert PDF documents but I can't figure out how to convert the PDF to a Word document. Does anyone know how the do this?
    Thanks.
    Andrew

    Which of these things did you buy?
    - ExportPDF
    - PDF Pack
    - Acrobat Standard
    - Acrobat Pro
    - Acrobat Plus

  • SWT inside of Swing?

    Simply put, can I use an SWT component inside of a JDialog, JFrame, or JInternalFrame?
    I've been searching for this answer all over and while apparently I can use a Swing component in SWT I cant find any example of using SWT inside of Swing.

    SWT only provides a way to embed swing and not the other way around (as far as I know of) so you might have a problem.
    If you want to embed a native browser look at the JDIC project which has this ability.
    https://jdic.dev.java.net/
    1 small warning though, I have played around with this and when switching between visible and non visible panels (some contain this brower) I saw some native code errors and the entire app crashed so just be carefull how you use it.

  • How to convert a class file to exe file and how to cteate a class file to d

    how to convert a class file to exe file

    Hi Bhaskarq,
    Hi,
    It is not at all possible.
    But it is a really worst method.
    Please go through it.
    This is a very common question asked in the comp.lang.java newsgroup. Its often useful to have an
    executable application when deploying your
    applications to a specific platform, but remember to
    make your .class files available for users running
    Unix/Macintosh/other platforms.
    Microsoft provide a free system development kit (SDK),
    for Java, which includes the jexegen tool. This
    will convert class files into a .EXE form. The only
    disadvantage is that users need a Microsoft Java
    Virtual Machine (JVM) installed. If your target
    platform is Win32, you can either redistribute the
    virtual
    machine, or raise the level of your system
    requirements, to include Windows 98, or Windows 95
    with
    Internet Explorer 4. Systems matching these
    requirements will already have a copy of the Microsoft
    Java Virtual Machine installed.
    Note : You must specify all of the class files your
    application needs (except for standard java packges)
    as a parameter, so if you have third party libraries,
    you'll need to include them as well. You can use wildcards * though, and you don't need the original source code.
    Also please see this Forum which will give a good idea
    http://forum.java.sun.com/thread.jsp?forum=31&thread=149733
    I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

Maybe you are looking for

  • Vendor Quality Rating

    Hi QM Experts,   My client is calculating Vendor Quality Rating based on following Formula QR  = ( (Q1Q2X1Q3X2Q5X3Q6X4+Q7X5)/Q ) *100 QR = Quality Rating Q1 = Quantity  Accepted                                 Q2= Quantity Accepted with Deviation Q3=

  • When opening apps a message pops up saying access iTunes to receive push notifications. Already tried syncing any other suggestions

    I updated my iPhone a week ago and everything was working fine. I got on my PC laptop yesterday and there was a notification for an iTunes update. When I tried to update my Internet was down and the update cancelled. I called my ISP and they fixed th

  • Question bout the setup of my vid card

    ok in the bios it says my agp aperture size is 64mb now thats the same mb as my 5200 my question is Do i have to increase that to 128mb to get the full performance of my new video card (geforce fx5900xt 128mb)??

  • Best practice for RAC RMAN backup

    I have a 10gR2 RAC db that is 3.5TB. It is a 2 node cluster on AIX. Each instance is db1 on node1, and db2 on node2, the "world" database name is db. Currently we are doing our backup from 1 node of the cluster, specifying that it connect to to db2,

  • Stains on RETINA DISPLAY - Who can spot them?

    There are two small 'stains' close to both bottom corners on my retina display. Only visible when screen is grey - then these areas are lighter / whiter - it looks to me as they come from the assembly process when someone would hold the glass in thos