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)

Similar Messages

  • Difference between AWT,Swing and swt

    Hello,
    I am giving a seminar about swing in which I need to point out differences between AWT,Swing and SWT(Software Widget Tool).
    I have two questions:
    1)I read that-A heavyweight component is one that is associated with its own native screen resource (commonly known as a peer). A lightweight component is one that "borrows" the screen resource of an ancestor-which makes it lighter.Can anybody explain What native screen resource is and how it is borrowed?
    2)I read that SWT uses native widgets and how can it be better than swing?If it is in what way?

    Use Swing for new projects. AWT is the rendering layer underneath Swing in many cases, and AWT provides utility things like Graphics. SWT is an alternative to Swing which used more native rendering, but actually with Java 6, Swing is using a lot of native rendering.
    Fire up NetBeans and use Matisse. Build an application. Run it under Windows, and then under Linux, and then realize how great it is.

  • Hibernate problem..... using projection and conjunction together..

    hi all ,
    can we use projection and conjunction together??
    i want to execute a query like this..
    select column_1 , column_2 from table_name where column_1 like '%a' ;

    hi ian
    you could also try verifying if the jar libraries containing your Document and Paragraph classes are defined in your class path OR if you are using an IDE, did you include that under your LIbraries?
    The previous suggestion below also is a stop-gap to the library inclusion problem.
    Hope that helps

  • Use bottom and protect together

    Hi all,
    May I know the that possible to use BOTTOM and PROTECT together with few lines of text inbetween?
    Eg:
    BOTTOM
    PROTECT
    texttexttext
    texttexttext
    texttexttext
    ENDPROTECT
    ENDBOTTOM
    or
    PROTECT
    BOTTOM
    texttexttext
    texttexttext
    texttexttext
    ENDBOTTOM
    ENDPROTECT
    Above code dont work for me. Please advice thank!!!

    Hi Kek,
    Refer this link,
    [Bottom..Endbottom|http://help.sap.com/saphelp_nw70/helpdata/en/d6/0db4a9494511d182b70000e829fbfe/content.htm]
    Regards,
    Sravanthi

  • Using Concat and Distinct together

    hi
    I am using the query below and I am getting 'missing expression' error. How do use Distinct and concat together?
    SELECT 'SELECT ' || DISTINCT COLUMN || ' FROM DUAL UNION ALL '
    FROM TABLE;

    Hi,
    SeshuGiri wrote:
    hi
    I am using the query below and I am getting 'missing expression' error. How do use Distinct and concat together?
    SELECT 'SELECT ' || DISTINCT COLUMN || ' FROM DUAL UNION ALL '
    FROM TABLE;Whenever you have a problem, please post CREATE TABLE and INSERT statments for a little sample data, and the results you want from that data.
    The example you posted has so many mistakes, it's hard to know what you're trying to do.
    COLUMN, DISTINCT and TABLE are all Oracle keywords, and shouldn't be used for actual columnor table names, and using them for aliases is just asking for trouble.
    When using SELECT DISTINCT, the keyword DISTINCT must come immediately after SELECT.
    If you want to assign an alias to a column, it must be at the very end of the expression that defines the column. You can't assign an alias to part of an expression. If you want to do that, use a sub-query.
    Here's a query that uses both SELECT DISTINCT and ||:
    SELECT DISTINCT
            job || deptno    AS jd
    FROM    scott.emp;Edited by: Frank Kulash on May 13, 2011 2:52 PM

  • Using Airport And Ethernet Together

    Having read Christopher Breen's solution to using Airport and Ethernet together,
    http://www.macworld.com/weblogs/mac911/2006/10/airportswitch/index.php
    I am still wondering if this can apply to my situation. I have an Airport Exteme BS distributing the wireless signal on it's own node. Nothing is physically connected to the BS except an ethernet cable running to a hub which is connected to the cable modem. While my ISP service isn't supplying service faster than Airport will manage, no problem...but, I would like to have the advantage ethernet networking between my machines for all the advantages that ethernet speed can bring to that situation.
    My connection to the internet is from WAN from the cable modem. I have an ethernet connection from the BS that I can run a cable back to say, an iBook. Will this work? I want wireless internet, but ethernet for machine to machine networking.
    JAL
    iBook G3/500 G4/Dual 450 Mac OS X (10.4)
    iBook G3/500 G4/Dual 450 Mac OS X (10.4)

    Helpful response, but I am uncertain this is what I am after. First, the hub is at the other end of the house, inconvenient to run a cable to it in this way. Presently, "Distribute IP Addresses" is turned off. This is way it had to be set since the AEBS is on a separate node. I just wonder why I can't run a cable from the AEBS LAN port back to the iBook. Looking for best possible speed when networking from my studio G4 while keeping the wireless internet setting.
    Any reason making the config the way I am imagining will not work?

  • Need  java code to perform refresh button action using swings and awt

    i need java code to perform refresh button action using swings and awt.please help me

    Wait ! Noboby ? OK, I'll do it
    public void onBtnAction ()
        if (!fresh)
            refresh ();
    }Seriously, did you expect anyone to answer such a cryptic question ?

  • I want to use ps and illustrator together, but I just bought the photoshop membership, could I upgrade my membership?

    I want to use ps and illustrator together, but I just bought the photoshop membership, could I upgrade my membership?

    You may upgrade to the entire plan, or just add an individual program subscription
    Upgrade single to all Cloud http://forums.adobe.com/thread/1235382
    Cloud Plans https://creative.adobe.com/plans
    -and subscription terms http://www.adobe.com/misc/subscription_terms.html
    -what is in the entire Cloud http://www.adobe.com/creativecloud/catalog/desktop.html
    -http://www.adobe.com/products/catalog/mobile._sl_id-contentfilter_sl_catalog_sl_mobiledevi ces.html

  • Using swingworker and invokeLater together

    Hi all�
    Anyone knows if there is an appropiate way to use the worker thread through SwingWorker and invokeLater together?
    It maybe sounds a bit weird but I have to launch a thread from EDT with invokeLater utility, otherwise i'd get a block state between EDT and my own thread. In other hand, I need to use SwingWorker utility for try to avoid the awful effect of loosing the visual desktop while transaction is proccesing.
    Obviously, if i use SwingWorker and inside doInBackGorund method, launch my thread with invokeLater it doesnt make any sense since the worker do its work in differents threads...
    I'd appreciate any help concerning this problem.

    Hi Albert,
    I believe that this code might help:
    /*SwinWorker Clas*/
    package swingworker;
    import javax.swing.SwingUtilities;
    * This is the 3rd version of SwingWorker (also known as
    * SwingWorker 3), an abstract class that you subclass to
    * perform GUI-related work in a dedicated thread.  For
    * instructions on using this class, see:
    * http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
    * Note that the API changed slightly in the 3rd version:
    * You must now invoke start() on the SwingWorker after
    * creating it.
    public abstract class SwingWorker {
        private Object value;  // see getValue(), setValue()
        private Thread thread;
         * Class to maintain reference to current worker thread
         * under separate synchronization control.
        private static class ThreadVar {
            private Thread thread;
            ThreadVar(Thread t) { thread = t; }
            synchronized Thread get() { return thread; }
            synchronized void clear() { thread = null; }
        private ThreadVar threadVar;
         * Get the value produced by the worker thread, or null if it
         * hasn't been constructed yet.
        protected synchronized Object getValue() {
            return value;
         * Set the value produced by worker thread
        private synchronized void setValue(Object x) {
            value = x;
         * Compute the value to be returned by the <code>get</code> method.
        public abstract Object construct();
         * Called on the event dispatching thread (not on the worker thread)
         * after the <code>construct</code> method has returned.
        public void finished() {
         * A new method that interrupts the worker thread.  Call this method
         * to force the worker to stop what it's doing.
        public void interrupt() {
            Thread t = threadVar.get();
            if (t != null) {
                t.interrupt();
            threadVar.clear();
         * Return the value created by the <code>construct</code> method.
         * Returns null if either the constructing thread or the current
         * thread was interrupted before a value was produced.
         * @return the value created by the <code>construct</code> method
        public Object get() {
            while (true) {
                Thread t = threadVar.get();
                if (t == null) {
                    return getValue();
                try {
                    t.join();
                catch (InterruptedException e) {
                    Thread.currentThread().interrupt(); // propagate
                    return null;
         * Start a thread that will call the <code>construct</code> method
         * and then exit.
        public SwingWorker() {
            final Runnable doFinished = new Runnable() {
               public void run() { finished(); }
            Runnable doConstruct = new Runnable() {
                public void run() {
                    try {
                        setValue(construct());
                    finally {
                        threadVar.clear();
                    SwingUtilities.invokeLater(doFinished);
            Thread t = new Thread(doConstruct);
            threadVar = new ThreadVar(t);
         * Start the worker thread.
        public void start() {
            Thread t = threadVar.get();
            if (t != null) {
                t.start();
    /*TestSwingWorker*/
    package swingworker;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MyApplication {
        public static void main(String[] argv) {
            final JFrame f = new JFrame("Test SwingWorker");
            /* Invoking start() on a SwingWorker causes a new Thread
             * to be created that will run the worker.construct()
             * method we've defined here.  Calls to worker.get()
             * will wait until the construct() method has returned
             * a value (see below).
            final SwingWorker worker = new SwingWorker() {
                public Object construct() {
                    return new ExpensiveDialogComponent();
            worker.start();  //new for SwingWorker 3
            /* The ActionListener below gets a component to display
             * in its message area from the worker, which constructs
             * the component in another thread.  The call to worker.get()
             * will wait if the component is still being constructed.
            ActionListener showSwingWorkerDialog = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    JOptionPane.showMessageDialog(f, worker.get());
            JButton b = new JButton("Click here to show component constructed by SwingWorker");
            b.addActionListener(showSwingWorkerDialog);
            f.getContentPane().add(b);
            f.pack();
            f.show();
            //The following is safe because adding a listener is always safe.
            f.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
    class ExpensiveDialogComponent extends JLabel {
        public ExpensiveDialogComponent() {
            super("This is the world's most expensive label.");
            try {
                Thread.sleep(10000); //sleep for 10 seconds
            } catch (InterruptedException e) {
    }Hope it helps!

  • Using SWING and EJB

    Had nebody used Swing for GUI and EJBs for business logic. HEre i need to use Swing for gui rather than JSPs.
    Can nebody help??

    My question is ...
    How do u call EJBs from swing based applets..
    In J2EE transaction management cud be done at server side but how will we manage with the swing app??

  • Using generics and J2SE together with JSF

    Hi
    Has anybody experience with using JSF together with J2SE 1.5? Especially generics? I would like to use generics and other improvements from J2SE in the model objects.
    Thnaks in advance ... Rick

    JSF 1.1 is specified for J2SE 5, and the new specification (JSF 1.2 and JSP 2.1) does not include generics.
    If you are talking in terms of ValueBindings or MethodBindings, there really isn't any point since the implementation could only make the cast for you; and it would still not be able to garuantee type safety (the only reason to use generics).
    That's not to say you couldn't use generics in your own development, but I don't think you will see generics incorporated into the specification any time soon.
    Jacob Hookom (JSR-252 EG)

  • Using Struts and JSTL together

    I have
    <html:form action="xy.do">
    <c:set var="name" value="shalik"/>
    <html:text property="name" value="<c:out value="${name}"/>"/>
    </html:form>
    How could I put data stored in ${name} to show in the text
    Also, is there a shorter way to access java variables using jstl core
    I would not want to do
    <input type="text" name="name" value="<c:out value="${name}"/>"/>
    which works, because I have to use struts

    No you can't include tags as attributes to other tags.
    Yes, you can definitely use the Struts and JSTL together.
    If you want to use EL expressions with the struts tags, it depends on your server.
    If you have a JSP2.0 container (eg Tomcat 5) its no problem at all. You can use the EL expressions directly with the standard struts tags.
    For a JSP1.2 container, there are specifically written struts-el tags. They let you use EL expressions instead of <%= %> expressions
    <c:set var="name" value="shalik"/>
    <html:text property="name" value="${name}"/>The struts-el tags only have a subset of the struts tags. It is intended for use with the JSTL. For instance the c:if tag easily replaces a lot of the logic conditional ones (equal, lessThan, etc etc)
    The tags are available as part of the standard struts download in the contrib directory.
    However for what you seem to be wanting to do, wouldn't it be more struts-like to have an action that specifically populates the action form, and just have
    <html:text property="name"/>
    The value would then be automagically populated from the form bean.
    Hope this helps,
    evnafets

  • Using forall and bulkcollect together

    Hey group,
    I am trying to use bulk collect and forall together.
    i have bulk collect on 3 columns and insert is on more than 3 columns.can anybody tell me how to reference those collection objects in bulk collect statement.
    you can see the procedure,i highlighted things am trying.
    Please let me know,if am clear enough.
    PROCEDURE do_insert
    IS
    PROCEDURE process_insert_record
    IS
    CURSOR c_es_div_split
    IS
    SELECT div_id
    FROM zrep_mpg_div
    WHERE div_id IN ('PC', 'BP', 'BI', 'CI', 'CR');
    PROCEDURE write_record
    IS
    CURSOR c_plan_fields
    IS
    SELECT x.comp_plan_id, x.comp_plan_cd, cp.comp_plan_nm
    FROM cp_div_xref@dm x, comp_plan@dm cp
    WHERE x.comp_plan_id = cp.comp_plan_id
    AND x.div = v_div
    AND x.sorg_cd = v_sorg_cd
    AND x.comp_plan_yr = TO_NUMBER (TO_CHAR (v_to_dt, 'yyyy'));
    TYPE test1 IS TABLE OF c_plan_fields%ROWTYPE
    INDEX BY BINARY_INTEGER;
    test2 test1;
    BEGIN -- write_record
    OPEN c_plan_fields;
    FETCH c_plan_fields bulk collect INTO test2;
    CLOSE c_plan_fields;
    ForAll X In 1..test2.last
    INSERT INTO cust_hier
    (sorg_cd, cust_cd, bunt, --DP
    div,
    from_dt,
    to_dt,
    cust_ter_cd, cust_rgn_cd, cust_grp_cd,
    cust_area_cd, sorg_desc, cust_nm, cust_ter_desc,
    cust_rgn_desc, cust_grp_desc, cust_area_desc,
    cust_mkt_cd, cust_mkt_desc, curr_flag,
    last_mth_flag, comp_plan_id, comp_plan_cd,
    comp_plan_nm, asgn_typ, lddt
    VALUES (v_sorg_cd, v_cust_cd, v_bunt, --DP
    v_div,
    TRUNC (v_from_dt),
    TO_DATE (TO_CHAR (v_to_dt, 'mmddyyyy') || '235959',
    'mmddyyyyhh24miss'
    v_ter, v_rgn, v_grp,
    v_area, v_sorg_desc, v_cust_nm, v_cust_ter_desc,
    v_rgn_desc, v_grp_desc, v_area_desc,
    v_mkt, v_mkt_desc, v_curr_flag,
    v_last_mth_flag, test2(x).comp_plan_id,test2(x).comp_plan_cd,
    test2(x).comp_plan_nm, v_asgn_typ, v_begin_dt
    v_plan_id := 0;
    v_plan_cd := 0;
    v_plan_nm := NULL;
    v_out_cnt := v_out_cnt + 1;
    IF doing_both
    THEN
    COMMIT;
    ELSE
    -- commiting v_commit_rows rows at a time.
    IF v_out_cnt >= v_commit_cnt
    THEN
    COMMIT;
    p.l ( 'Commit point reached: '
    || v_out_cnt
    || 'at: '
    || TO_CHAR (SYSDATE, 'mm/dd hh24:mi:ss')
    v_commit_cnt := v_commit_cnt + v_commit_rows;
    END IF;
    END IF;
    END write_record;

    Ugly code.
    Bulk processing does what in PL? One and one thing only. It reduces context switching between the PL and SQL engines. That is it. Nothing more. It is not magic that increases performance. And there is a penalty to pay for the reduction in context switching - memory. Very expensive PGA memory.
    To reduce the context switches, bigger chunks of data are passed between the PL and SQL engines. You have coded a single fetch for all the rows from the cursor. All that data collected from the SQL engine has to be stored in the PL engine. This requires memory. The more rows, the more memory. And the memory used is dedicated non-shared server memory. The worse kind to use on a server where resources need to be shared in order for the server to scale.
    Use the LIMIT clause. That controls how many rows are fetched. And thus you manage just how much memory is consumed.
    And why the incremental commit? What do you think you are achieving with that? Except consuming more resources by doing more commits.. not to mention risking data integrity as this process can now fail and result in only partial changes. And only changing some of the rows when you need to change all the rows is corrupting the data in the database in my book.
    Also, why use PL at all? Surely you can do a INSERT into <table1> SELECT .. FROM <table2>,<table3> WHERE ...
    And with this, you can also use parallel processing (DML). You can use direct path inserts. You do not need a single byte of PL engine code or memory. You do not have to ship data between the PL and SQL engines. What you now have is fast performing code that can scale.

  • Swings and networking together???

    hi can anyone help me out with this. I have made a console based client and server connection...now i want to convert it into GUI based using swings. The objective is to send text-textarea from one side to the text area of another side.....and also how to convert the strings into bytes? Thanks

    Look at the documentation for String.getBytes(encoding).
    For example
    byte[] bytesFromString = "Hello".getByte("UTF-8");

  • Question for using PXIe and USRP together

    Hello.
    I am very new at using USRP-2943R and PXIe-8135, 5652, 5601, 5622, 8374.
    Literally, I don't have any idea how to use above USRP and PXIe together.
    Now, I connected USRP-2943R to PXIe-8374 which is linked with PXIe-8135.
    I want to make QPSK example with theses equipments by using LABVIEW.
    But the problem is there is no manual how to use like that.(or I coun't find it yet. XD)
    Could someone give me any comment and manuals to use these equipments for making basic communication system?
    Please gents and ladies, give me any comment. 
    My e-mail :  [email protected]
    Thank you so much your reding.
    Best regards.

    Neeraj,
    I created the attached VI and tested it on my system, it works fine. Can you try this and see if it works for you?
    Thanks,
    Abhinav T.
    National Instruments
    Abhinav T.
    Applications Engineering
    National Instruments India
    LabVIEW Introduction Course - Six Hours
    Getting Started with NI-DAQmx
    Measurement Fundamentals
    Attachments:
    ELVIS test.vi ‏120 KB

Maybe you are looking for

  • FLEX Developer needed in Little Rock

    Local company in Little Rock, AR seeks 2 Senior Web Developers for 6-18 month contracts. The positions will encompass creative interface design, coding, table and data store creation and converting specific and nebulous corporate and customer busines

  • STEP BY STEP PROCESS TO IMPLEMENT BW IN A SAP - R3 ENVIRONMENT

    Hai experts!!!, An organisation is running on SAP for the past 3 years, it is planning to implement SAP-BW. what are all the steps for implementing this process. Thanks in advance. Regards, Giri

  • Infopackage red in process chain but green in monitor

    With our system (BW30B, patch14, W2K, Oracle 9.2.0.5) we are having some issues with some infopackages which are included in a process chain. In the process chain, the status is red with the following error messages: "Processing in Warehouse timed ou

  • I have 2 caps lock notifications and they respond slowly

    Hi, I have now got 2 caps lock notification boxes in the bottom right hand corner. This I suppose I can deal with it's the fact that most of the time when I have pressed the caps lock they show up sometimes 1 or 2 and then the keyboard is slow to res

  • Where is Service Ticket Categories in BOL

    We're using CRM_IC in 5.0 and we need to add Service Ticket Categories to the FollowupDetails view. I know categories exist in BOL because they are in the Context of another view (SrvTViewSet). But I cannot find them anywhere in the BOL/GENIL browser