QT versus Swing

hi,
does anyone have any opinion on the relative areas of strength/weakness of QT(http://www.trolltech.com/) and Swing?
I've know Swing mediumly well, and have just started looking at QT a little. The style of programming seems quite familiar (QObject, QWidget etc..) but there doesn't seem to be any deep similarities between the graphical class hierachies that I was half expecting?
it also has support for platform independent file/network access etc.. but on a first skim read of the whitepaper these don't seem to be nearly as well developed as the standard edition java libraries (?).
on speed, QT 'feels' a lot faster but i've very limited experience with it for anything other than the toy apps in their tutorials. Swing seems pretty fast to me but often people complain that its slow (eg the very existence of SWT suggests it has some kind of problem)
any help really appreciated,
thanks,
asjf

thanks for the replies :)
are there any areas that QT is much better than Swing (apart from speed!)
eg. Swing supports html (although seemingly to quite a low spec), QT as far as I can tell doesn't (?)
looking at the layout manager class names for QT i also got the impression that there were not as many - does this translate to it being slightly harder to lay out widgets?
also the slot/signal approach to event handling seems very alien to me coming from the XXXListener swing approach - what is it like to work with? is code reuse still possible through the equivalent of extending existing listeners?
thanks,
asjf

Similar Messages

  • Forms vs UIX/ADF Faces ?

    Hi,
    We are considering to migrate Forms application into J2EE Web Apps (UIX or ADF Faces), using JHeadStart as rapid dev tool.
    Does any body know, how is the UIX/ADF Faces performance compared to Forms, provided they are deployed on same IAS and network specification and bandwidth ?
    Is it true that UIX/ADF Faces will need smaller bandwidth than Forms ?
    Or are there any other reason that will justify us to migrate Forms into J2EE Web app ?
    Thank you for your help,
    xtanto

    do not duplicate your question so much times...
    UIX versus Swing
    UIX
    many of the old authors are not frequently here in the forum. Go to the JDeveloper-Forum

  • Speed of Swing versus double buffered AWT

    Hello
    I've noticed that drawing in a JPanel.paintComponent() takes about 4 times longer than drawing into an offscreen image in AWT Canvas.paint()
    Essential code excerpts follow
    // SWING, takes about 400 millis on my machine
    public void paintComponent(Graphics g) {
    g.setColor(Color.red);
    long startTime = System.currentTimeMillis();
    for (int i = 0; i < 10000; i++)
    g.draw3DRect((int) (Math.random() * 200), 20, 30, 40, true);
    long endTime = System.currentTimeMillis();
    System.out.println("paintComponent() took " + (endTime - startTime) + " millis");
    // AWT, takes about 100 millis on same machine
    public void paint(Graphics g) {
    if (offscreenGraphics == null || offscreenImage == null) {
    offscreenImage = createImage(getWidth(), getHeight());
    offscreenGraphics = offscreenImage.getGraphics();
    long startTime = System.currentTimeMillis();
    if (offscreenGraphics != null) {
    offscreenGraphics.setColor(Color.red);
    for (int i = 0; i < 10000; i++)
    offscreenGraphics.draw3DRect((int) (Math.random() * 200), 20, 30, 40, true);
    g.drawImage(offscreenImage, 0, 0, this);
    long endTime = System.currentTimeMillis();
    System.out.println("paint() took " + (endTime - startTime) + " millis");
    Note that I also tried drawLine() instead of draw3DRect() and experienced similar results
    Can someone explain why doing this in Swing is so slow?
    I'd hoped to take advantage of Swing's double buffering, but I ended up using the same old offscreen image technique in Swing.
    Nick Didkovsky

    Silly question, but did you turn on double buffering or extend a Swing component which has it on by default?
    Not all of them do.
    : jay

  • Java Swing versus UIX

    Hi All,
    I am new to Orackle UIX.
    could anyone please help me in understanding the difference between
    UIX and Swing.
    Can i get somewhere the comparitive study between these two technologies.
    can i use UIX for desktop applications?
    -Anurag

    UIX is replaced by ADF Faces see this doc:
    http://www.oracle.com/technology/products/jdev/collateral/papers/9.0.5.0/adfuix_roadmap/adfuix_roadmap.html
    For more about ADF Faces see this site:
    http://www.oracle.com/technology/products/adf/adffaces/index.html
    For more about binding read the ADF Developer Guide and tutorial:
    http://www.oracle.com/technology/products/adf/learnadf.html

  • Swing application eats CPU on resume after standby

    My application contains a mix of regular Swing components and about 200 (small) custom components (JPanels) that draw themselves. The problem is that if put my laptop into Standby, then restart it, the application eats CPU. It goes from ~4% pre standby to ~48% after standby. Totally repeatable. There is only the main thread, the AWT thread and a couple timers firing: one to get data from a server and one to redraw the custom controls to make the control blink (calls repaint() to cue up a call to paintComponent()). I put timing code in the two timer driven threads and both are running fine. NOTE: each of the custom components is just a rectangle with a short text string in it. Think checkerboard with text. The background color is all that is being changed. It's basically a grid of alarm/status "lights".
    I did some searching and only found a reference to a drawing bug that was fixed back in 1.4.x that had to do with WinXP and dual-headed computers.
    Note that another simple Swing application I wrote (no custom controls), doesn't appear to behave this way, so I suspect it has to do with the custom drawing stuff (rolling my own paintComponent() method).
    Any thoughts on how to figure out what is eating the CPU? I'm using NetBeans 6.7 and JDK 1.6_14 under Windows XP.
    Edited by: garrysimmons on Sep 15, 2009 1:52 PM
    Edited by: garrysimmons on Sep 15, 2009 2:57 PM
    Edited by: garrysimmons on Sep 15, 2009 3:02 PM

    It doesn't matter if it's a Swing timer or a Util timer. It behaves the same either way. That was one of the first things I tried.
    I ended up refactoring the code to go from a grid of individual controls (think checker board where each square is a control that draws itself), to a single "board" control that draws a grid. That seems to have fixed the issue. I can go in/out of Standby and the app doesn't eat a ton of CPU any more. The real problem may still be there, just too small of an effect to notice.
    I don't know why the original design would work fine before a Standby, but not after. Having ~200 little controls doing repaints twice a second must confuse something in the JVM/Windows versus having 4 large controls doing the same amount of drawing.
    It's working, so time to move on.

  • Java 1.1.x versus 1.4.x

    Hi,
    I am interested is the differents between Java 1.1 versus 1.4. I can imagine that 1.4 would be better because of Swing and XML etc. but what is more important to me is to know if 1.4 is more stable, faster, reliable, etc then 1.1.
    Also it is known that Swing classes aren't thread safe. Is this still an issue in 1.4?
    Can anyone also point me some articles or whitepapers were people investigated the differences?
    Kinds Regards,
    Arno

    I don't know how stable 1.4 is, but you can use 1.3.1 instead if you are in doubt and wait for 1.4.1.
    The only reason why you would want to use 1.1.x, is that it can run in the old browsers without a plugin. 1.2-1.4 has the same classes as 1.1, plus many more new features.
    I don't really feel that swing is faster than awt, it is at least slower to start a swing gui than a gui build with awt components only, probably because the swing gui needs to load many more classes. But you can do much more with swing without making customized components.
    If you want to know what the new features are from one release to another, check the docs:
    http://java.sun.com/products/jdk/1.2/docs/relnotes/features.html
    http://java.sun.com/products/jdk/1.3/docs/relnotes/features.html
    http://java.sun.com/j2se/1.4/docs/relnotes/features.html

  • Problem with threads in my swing application

    Hi,
    I have some problem in running my swing app. Thre problem is related to threads.
    What i am developing, is a gui framework where i can add different pluggable components to the framework.
    The framework is working fine, but when i press the close action then the gui should close down the present component which is active. The close action is of the framework and the component has the responsibility of checking if it's work is saved or not and hence to throw a message for saving the work, therefore, what i have done is that i call the close method for the component in a separate thread and from my main thread i call the join method for the component's thread.But after join the whole gui hangs.
    I think after the join method even the GUI thread , which is started for every gui, also waits for the component's thread to finish but the component thread can't finish because the gui thread is also waiting for the component to finish. This creates a deadlock situation.
    I dont know wht's happening it's purely my guess.
    One more thing. Why i am calling the component through a different thread, is because , if the component's work is not saved by the user then it must throw a message to save the work. If i continue this message throwing in my main thread only then the main thread doesnt wait for user press of the yes no or cancel button for saving the work . It immediately progresses to the next statement.
    Can anybody help me get out of this?
    Regards,
    amazing_java

    For my original bad thread version, I have rewritten it mimicking javax.swing.Timer
    implementation, reducing average CPU usage to 2 - 3%.
    Will you try this:
    import javax.swing.*;
    import java.awt.*;
    import java.text.*;
    import java.util.*;
    public class SamurayClockW{
      JFrame frame;
      Container con;
      ClockTextFieldW ctf;
      public SamurayClockW(){
        frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        con = frame.getContentPane();
        ctf = new ClockTextFieldW();
        con.add(ctf, BorderLayout.SOUTH);
        frame.setBounds(100, 100, 300, 300);
        frame.setVisible(true);
        ctf.start();
      public static void main(String[] args){
        new SamurayClockW();
    class ClockTextFieldW extends JTextField implements Runnable{
      String clock;
      boolean running;
      public ClockTextFieldW(){
        setEditable(false);
        setHorizontalAlignment(RIGHT);
      public synchronized void start(){
        running = true;
        Thread t = new Thread(this);
        t.start();
      public synchronized void stop(){
        running = false;
      public synchronized void run(){
        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
        try{
          while (running){
            clock = sdf.format(new Date());
            SwingUtilities.invokeLater(new Runnable(){
              public void run(){
                setText(clock);
            try{
              wait(1000);
            catch (InterruptedException ie){
              ie.printStackTrace();
        catch (ThreadDeath td){
          running = false;
    }

  • How to get the values from a html form embedded in a swing container

    Hi all,
    I am developing an application in which i have to read a html file and display it in a swing container.That task i made it with the help of a tool.But now i want to get the values from that page.ie when the submit button is clicked all the values of that form should be retrived by a servlet/standalone application.I don't know how to proceed further.Any help in this regard will be very greatful
    Thanks in advance,
    Prakash

    By parsing the HTML.

  • Is there free java chat, which i can embed in my Swing application

    Hello all,
    I have a Swing application and i want to embed java chat into it.
    Can you recommend me free chat for which i can see and modofy client and server sources.
    Regards,
    Chavdar

    No.

  • How to give Common Background color for all JPanels in My Swing application

    Hi All,
    I am developing a swing application using The Swing Application Framework(SAF)(JSR 296). I this application i have multiple JPanel's embedded in a JTabbedPane. In this way i have three JTabbedPane embedded in a JFrame.
    Now is there any way to set a common background color for the all the JPanel's available in the application??
    I have tried using UIManager.put("Panel.background",new Color.PINK);. But it did not work.
    Also let me know if SAF has some inbuilt method or way to do this.
    Your inputs are valuable.
    Thanks in Advance,
    Nishanth.C

    It is not the fault of NetBeans' GUI builder, JPanels are opaque by default, I mean whether you use Netbeans or not.Thank you!
    I stand corrected (which is short for +"I jumped red-eyed on my feet and rushed to create an SSCCE to demonstrate that JPanels are... mmm... oh well, they are opaque by default... ;-[]"+)
    NetBeans's definitely innocent then, and indeed using it would be an advantage (ctrl-click all JPanels in a form and edit the common opaque property to false) over manually coding
    To handle this it would be better idea to make a subclass of JPanel and override isOpaque() to return false. Then use this 'Trasparent Panel' for all the panels where ever transparency is required.I beg to differ. From a design standpoint, I'd find it terrible (in the pejorative sense of the word) to design a subclass to inconsistently override a getter whereas the standard API already exposes the property (both get and set) for what it's meant: specify whether the panel is opaque.
    Leveraging this subclass would mean changing all lines where a would-be-transparent JPanel is currently instantiated, and instantiate the subclass instead.
    If you're editing all such lines anyway, you might as well change the explicit new JPanel() for a call to a factory method createTransparentJPanel(); this latter could, at the programmer's discretion, implement transparency whichever way makes the programmer's life easier (subclass if he pleases, although that makes me shudder, or simply call thePanel.setOpaque(false) before returning the panel). That way the "transparency" code is centralized in a single easy to maintain location.
    I had to read the code for that latter's UI classes to find out the keys to use (+Panel.background+, Label.foreground, etc.), as I happened to not find this info in an authoritative document - I see that you seem to know thoses keys, may I ask you where you got them from?
    One of best utilities I got from this forum, written by camickr makes getting these keys and their values very easy. You can get it from his blog [(->link)|http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/]
    Definitely. I bit a pair of knucles off when discovered it monthes after cumbersomely traversing the BasicL&F code...
    Still, it is a matter-of-fact approach (and this time I don't mean that to sound pejorative), that works if you can test the result for a given JDK version and L&F, but doesn't guarantee that these keys are there to stand - an observation, but not a specification.
    Thanks TBM for highlighting this blog entry, that's the best keys list device I have found so far, but the questions still holds as to what specifies the keys.
    Edited by: jduprez on Feb 15, 2010 10:07 AM

  • How to get mouse wheel action in my swing application?

    Hi
    In my mouse, i am having mousewheel to support scrolling.With the help of the wheel, i can scroll the pages in IE browser or any other appliction.
    In swing application ,i have scroll bar inside a JFrame.I want to have mousewheel action in my swing application to support scrolling.
    any idea ???
    Thanks

    As far as I know,there is no facility for detecting mouse scrolling wheel in JDK 1.3.
    Check it in the later releases of JDK.

  • I want to implement thems functionality in  my swing application

    Hi All...
    I want to implement the themes object in my swing application,How ,where to start and move that functionality,If anybody use this functionality in your program experience can u share with me.
    Than to Advance
    ARjun...

    Hi Kuldeep Chitrakar
    I can do that in web intelligence. dont want that
    I am replicating some of the sample report of SQL Servers in BusinessObjects XI R3.1.
    One of the SQL Sever's report is of product catalogue type that gives complete information like name, category, description along with the products image etc... for each of the products.
    I am trying to replicate the above said SQL Server report in Business objects XI R3.1. I am facing problem in bringing the image in to my BO report. The image resides in a table and its datatype is of varbinary(max). I don't know the exact matching while creating an object in the uiverse designer.
    Here is the url link http://errorsbusinessobjectsxir3.blogspot.com/2010/10/business-objects-image-errors.html
    Regards
    Prasad

  • Can I build a GUI application with SWING only without [import java.awt.*;]

    I have seen several threads (in forums), books and tutorials about SWING and I see that they all mix SWING with AWT (I mean they import both Swing and AWT in their code).
    The conclusion that comes out is:
    It is good to learn about SWING and forget AWT as it won't be supported later. I have decided to do so, and I never include <<import java.awt.*;>> in my code.
    But I see that you cannot do much without <<import java.awt.*;>>. For example this line which changes the background color:
    <<frame.getContentPane().setBackground(Color.red)>>
    works only with <<import java.awt.*;>>. I have seen that codes in this and other forums import awt to change the background. Why is that?
    After all, I wonder, what can I do;
    My question is, can I change the background (and of course do all other things listener, buttons etc) without using <<import java.awt.*;>>.
    I would like to avoid using <<import java.awt.*;>> and using awt since my program will not work later.
    In addition, I believe there is no point to learn awt, which later will not exist.
    I know, I must have misunderstood something. I would appreceate it very much, if anyone could give me even a short answer.
    Thank you in advance,
    JMelsi

    Since swing is a layer on top of awt, AWT will exist for as long as swing does.
    If sun does ever remove AWT they will have to replace it something else swing can layer on to and you will probably only have to replace your import statements.
    The main difference is the way there drawn to the screen.
    You can do custom drawing on swing components but you can't on AWT.
    If your using a desktop PC system it's probably best to use swing just in case you wish to do some custom drawing.
    awt uses less memory than swing and is faster but swing can be extended. awt comes only as standard.
    Say for example you wish to implement a JButton with a ProgressBar below the button text, this can be done with swing!

  • Using the swing worker to populate the data in to jtablle

    Hello, i am developing my 1st application in java swings , i have developed it but when i run a module which fetchces the data from the mysql and display it in jtable my swing gui got blank for some initial time, i was thinking for some progress bar type thing but when i came acroos google i found that i can use swing worker to load my GUI on time and in the back ground i can do the task of fetching the data from the data base and populating the Jtable, but i had done a lot of try but not succeded to implement the swing worker . Please help me to implement the swing worker :( . i am using the abstractTableModal to populating the jtable it is working fine but swing worker is not there .
    Scenerio is like this i have base frame on which i got 1 or more btton one of those button is Clients when i click on it a Jdialog box appears with the jtable . Pleae tell me how to implement the swing worker class between this. Pleaseeeeeeeeeeeeeeeeeeeeee :( I am help less now .

    Fahim i want to display some photograph in to a swing application after fetching these photo graph from the database table , i dont know what swing component will be better for it and i m designing this in netbeans , so please assist me with that , how to go now and please note that it is dynamic so component should be like that :(. i m trying to create a photo album where i upload the multiple photograph first then i would like to show them each photograph will a text box when some one write some text in that text box and press enter i would like to save that text with that photo graph , I AM DONE WITH THE PHOTO UPLOADING TASK BUT DONT KNOW HOW TO DO THE REST LIKE DISPLAYING THE PHOTOGRAPH WITH THAT TEXT BOX .
    Edited by: kamal.java on Apr 27, 2012 8:59 AM

  • What is difference between C# Gzip and Java swing GZIPOutputStream?

    Hi All,
    I have a Java swing tool where i can compress file inputs and we have C# tool.
    I am using GZIPOutputStream to compress the stream .
    I found the difference between C# and Java Gzip compression while a compressing a file (temp.gif ) -
    After Compression of temp.gif file in C# - compressed file size increased
    while in java i found a 2% percentage of compression of data.
    Could you please tell me , can i achieve same output in Java as compared to C# using GZIPOutputStream ?
    Thank a lot in advance.

    797957 wrote:
    Does java provides a better compression than C#?no idea, i don't do c# programming. and, your question is most likely really: "does java default to a higher compression level than c#".
    Btw what is faster compression vs. better compression?meaning, does the code spend more time/effort trying to compress the data (slower but better compression) or less time/effort trying to compress the data (faster but worse compression). most compression algorithms allow you to control this tradeoff depending on whether you care more about cpu time or disk/memory space.

Maybe you are looking for

  • Unable to edit maintenance plan Sql Server 2008R2

    Hi All, I am unable to edit sql server maintenance plan and it is failing continuously from job as well.When I try to open the same the throws an error: Microsoft SQL Server Management Studio is unable to load this document.: Error loading from XML.

  • Oracle SOA Suite for Healthcare Integration

    Oracle SOA Suite for Healthcare Integration : *To provide healthcare customers with comprehensive healthcare integration capabilities within a unified enterprise application infrastructure platform, Oracle announced Oracle SOA Suite for healthcare in

  • Where are my Calendars?

    I recently moved a user from one computer to another using Migration Assistant. It took a couple weeks to stop using the onld computer so I had to move my calendar files manually. However, when I opened my user/Library/Calendars folder there was noth

  • 32-Bit Windows 7 IE8/9 Flash Player Size issue.

    I have a 24inch 1920x1080 monitor. I want to read the text on the screen but at the IE defualt of 100% it gets very tideous trying to read the wrighting and its the same with Adobe Flash player it becomes ridiculously small. I like to have my browser

  • Print Boilerplate once per page

    How can I print boilerplate once per page in between parent and child records? I tried using a summary column with Reset-At:Page, but I can't reference a Page-level column within a Format trigger. Any other ideas? (thanks in advance) pat