Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
GUI Graphics

What 2D GUI Foundation Do You Use? 331

Zmee writes "I am looking to build a 2D application for personal use and I will need to use a canvas to paint custom objects. I am trying to determine what foundation to use and have not located a good side-by-side comparison of the various flavors. For reference, I need the final application to work in Windows; Linux is preferred, but not required. I have looked at WPF, Qt, OpenGL, Tcl/Tk, Java's AWT, and others. I have little preference as to the language itself, but each of the tutorials appear to require significant time investment. As such, I am looking to see what the community uses and what seems to work for people prior to making that investment."
This discussion has been archived. No new comments can be posted.

What 2D GUI Foundation Do You Use?

Comments Filter:
  • HTML and Javascript? (Score:4, Informative)

    by Anonymous Coward on Sunday November 28, 2010 @12:15AM (#34362282)

    HTML and Javascript?

  • Anonymous Coward (Score:2, Informative)

    by Anonymous Coward on Sunday November 28, 2010 @12:15AM (#34362286)

    Have you checked out vpython? not many people have heard of it and I find it quite usable.

  • by Anonymous Coward on Sunday November 28, 2010 @12:15AM (#34362288)

    OpenGL is portable across all platforms, hardware accelerated, and lightweight. Win, win, win.

    Qt would be my next choice but it's not lightweight at all. You can always wrap your OpenGL app with Qt for extra "GUI stuff" if needed. OpenGL works with practically everything.

  • by CosmeticLobotamy ( 155360 ) on Sunday November 28, 2010 @12:19AM (#34362306)

    GDI+ is good enough for low frame rates and trivial to use if you have any C# experience. If these are static controls that need to be painted and then updated on user input, it's more than sufficient.

  • .NET Windows Forms (Score:4, Informative)

    by peterindistantland ( 1487953 ) on Sunday November 28, 2010 @12:21AM (#34362318)
    Nothing is easier for amateurs, even though I'm no Microsoft fan.
  • AWT or OpenGL (Score:5, Informative)

    by Philotomy ( 1635267 ) on Sunday November 28, 2010 @12:30AM (#34362352)
    I'd use Java AWT or OpenGL. They're both cross-platform, and what you learn will can be easily leveraged elsewhere, since they're widely adopted technologies. (No matter what you pick, you're going to have some learning curve.)
  • by Anonymous Coward on Sunday November 28, 2010 @12:34AM (#34362378)

    QT 4+ has been pretty decent. It has bindings for most languages and is really nice to work with.

  • WPF, Qt, or Python (Score:4, Informative)

    by PhrostyMcByte ( 589271 ) <phrosty@gmail.com> on Sunday November 28, 2010 @12:37AM (#34362388) Homepage

    Out of everything I've tried (pretty much everything usable from C, C++, and C#), WPF is the best UI framework around. It is extremely flexible and can be very intimidating if you try to learn all the details too quickly, but the basics of it are easy. You should be able to pop out a good design pretty quickly. It's a shame that Mono has no plans to implement it, because everything else feels primitive in comparison.

    If you don't mind dirtying your C++ with a less-than-modern design and ugly preprocessor hijinks, Qt can be a pretty solid framework. Works well on many platforms and is full of features. Has a lot of portable non-UI things too, but I haven't used much of it.

    Python's UI stuff is simple but has a lot of features. Great for quick, portable apps. Easy integration with C++ if you need it.

    I avoid wxWidgets. The last time I tried using it (about a year ago), I ended up very frustrated rooting around their code to find that it makes a bunch of stupid assumptions about things like DPI, default fonts, etc. that fall apart pretty easily.

    I also avoid GTK, but mainly just because it always feels "off" on Windows.

  • Qt (Score:5, Informative)

    by goruka ( 1721094 ) on Sunday November 28, 2010 @12:37AM (#34362392)
    Having used everything on the list and much more (such as wx, GTK, etc), as well as making my own toolkits for embedded devices and products, my personal experience tells me hands down that Qt is the best choice for anything GUI related. It's power, ease of use, tools, documentation and learning curve are unparalleled to this day and age. Any other toolkit or API I've use fails in one or more of such areas.
    Qt is the only toolkit that made me feel as if they could know in advance everything i'd ever need (so when i go to the docs it's there, right how as i imagined it should be), yet keeping the bloat down with great modularization. I have used it from C++ as well as from Python [pyside.org] with great success.
  • Qt (Score:5, Informative)

    by simula ( 1032230 ) on Sunday November 28, 2010 @12:39AM (#34362396) Homepage
    If you are comfortable with C++, I heavily recommend the Qt framework.
    • There is an LGPL ide Qt-Creator [nokia.com] that has an integrated form designer.
    • The code you write is amazingly cross-platform [nokia.com].
    • The framework is amazingly comprehensive [nokia.com] for when your needs expand.
    • There are top notch learning resources, including excellent books. [nokia.com]
    • The Qt framework is LGPL [nokia.com].

    I use the Qt framework at home and at work and I have published a couple teeny GPL'd apps:

    Regardless of which framework you decide to use, I wish you luck!

  • by TD-Linux ( 1295697 ) on Sunday November 28, 2010 @12:52AM (#34362436)
    OpenGL? "Lightweight"? Sure, I suppose because it's all implemented in the system, you don't have to redistribute much, but have you actually ever written anything remotely complicated in raw OpenGL? For anything resembling a GUI, the poster is going to spend months of writing low-level code that's been done a thousand times already.

    Qt is heavy, but it's heavy for a reason - it includes a very nice set of tried-and-true widgets, with all the nice features and weird corner cases thought of already. It's also fairly speedy, and even more so if you use QGraphicsView, which can be optionally accelerated via OpenGL for even more speed.

    Qt also has nice support for custom widgets. You can subclass any widget, or QWidget, and make anything you want. You can even integrate your custom widgets with Qt Designer, either by promoting a placeholder widget, or writing a Designer plugin so your widget is WYSIWYG.

    OpenGL is so low level that everything I talked in the last two paragraphs is completely beyond its scope. Even font rendering is rather arduous, and good luck with nicely word-wrapped, formatted text.
  • Swing + Java2D (Score:5, Informative)

    by SplashMyBandit ( 1543257 ) on Sunday November 28, 2010 @01:04AM (#34362512)

    Who suggested Java AWT? What is this, 1998? Someone is behind on their homework :).

    Java's Swing + Java2D is *fully hardware accelerated* (ever since Java 1.6.0_u10 some time ago), multi-platform, with good multi-thread support (not for rendering, you don't need that, but for the rest of the program), very customizable, and looks fantastic with the Nimbus look&feel (a standard part of Java). Swing is used a lot on the enterprise desktop (and a few shrink wrapped products too - I know I've purchased some as they were best-of-breed tools). Many of the Java Swing ttools are free and there are a lot of them (eg. Matisse in Netbeans makes creating GUIs a snap). Java2D had extensive contributions from Adobe who happen to know a thing or two about presentation. Plus, drawing in Java2D also allows printing relatively simply.

  • Quick n dirty. (Score:2, Informative)

    by noodler ( 724788 ) on Sunday November 28, 2010 @01:05AM (#34362526)

    I haven't got a clue what kind of app you want to write, but have a look at Processing.org .
    It's an abstraction layer built on top of Java (cross platformity, including web browsers).
    It has loads of handy stuff for 2D and 3D, including OpenGL.
    Talking about OpenGL, you can use it in it's raw form as well.
    In fact, you can just write in Java afaik.

    I found it very usefull for making custom ui's.

  • Qt has flaws (Score:4, Informative)

    by valkenar ( 307241 ) <valkenar@yahoo.com> on Sunday November 28, 2010 @01:18AM (#34362588) Journal

    I use QT and love it too, but it has some serious drawbacks, from my perspective. The biggest is that it requires a wonky special compilation system. You either have to use the build system they offer (qmake) or you have to manually run their generator yourself (moc - though if you were a masochist you could learn to write out the files moc makes yourself and avoid using it).

    I compare every IDE to Eclipse, because that's the best IDE I've seen for any language. But I've never found that CDT, the C++ plugin for Eclipse, is any good. It fails to work out of the box for me and is a pain to configure (but I haven't tried it in a few years). QT Creator, while usable, is really an immature product. There's no support for refactoring, the UI is unintuitive and awkward (for me, at least) and there's lots of little issues with it. Plus you're committed to MingW, which can be a problem depending on what libraries you want to use. Codeblocks is a pretty good IDE, but it doesn't have a QT plugin, so you're left with the problem of dealing with moc files. Visual Studio has a plugin, but it only works with the paid versions.

    All of this can be dealt with (and I do) but it's annoying.

  • Re:Qt (Score:5, Informative)

    by simula ( 1032230 ) on Sunday November 28, 2010 @01:21AM (#34362604) Homepage
    What do you want from the commercial license that you aren't getting with the LGPL version?

    The LGPL license allows you to close your product and distribute it without opening your source code as long as you link to the Qt dynamic libraries.

    If you make changes to Qt itself, you are required to open those changes back up, but as long as you utilize dynamic libraries, you can make your app as closed as you want.
  • Easy Choice (Score:4, Informative)

    by fean ( 212516 ) on Sunday November 28, 2010 @01:22AM (#34362608) Homepage

    Adobe Air -
    Easy UI interaction framework, very powerful drawing APIs, runs on windows/linux/mac/android.

    http://www.adobe.com/products/air/ [adobe.com]

    Latest version lets you call native apps on windows/linux/mac.

  • For "personal" Apps (Score:5, Informative)

    by ratboy666 ( 104074 ) <fred_weigel@[ ]mail.com ['hot' in gap]> on Sunday November 28, 2010 @01:29AM (#34362636) Journal

    I don't have much time... I write the GUI, and any drawing logic with Tcl/Tk. Easy, portable. Any time critical or extensive logic gets pushed into C or FORTRAN (depending on what it is). Just standard in/standard out. Parse the output with Tcl, and display.

    A recent example -- I needed to upgrade some systems for a client (Solaris 6 to 10). We needed to identify the binary parts (non-OS) that needed to move. I wrote a GUI tool (binport) for this. Took 2 days to write, ran on Linux and MacOS X (two of us shared the work). After the job, the tool was essentially discarded.

    No time to "debug" really, and I don't typically have time for compile and test cycles. Tcl is an interpreter, with very simple syntax and semantics.

    Other examples that have used Tcl/Tk -- the GUI layer for GDB, Redhat Source Navigator, etc.

    Yes, it's not "sexy", or even particularly "new", but it works, and works well.

  • Re:Qt has flaws (Score:4, Informative)

    by TD-Linux ( 1295697 ) on Sunday November 28, 2010 @01:30AM (#34362646)
    The "wonky" compilation system isn't bad, and the benefits it provides overcome any ideological "oh my we are corrupting the pure and wonderful C++" feelings that I might have. It's really easy to integrate into CMake, and it doesn't matter with autotools, because everything is hard with autotools.

    I also don't know where you got the idea that the VS plugin works only with paid versions. It works fine with the LGPL plugin for me.
  • Re:Swing + Java2D (Score:2, Informative)

    by Philotomy ( 1635267 ) on Sunday November 28, 2010 @01:58AM (#34362780)
    Java2D is part of AWT (take a look at the Java2D API and its packages). Ultimately, Swing is built on top of AWT (yes, even the lightweight widgets). The OP was talking about drawing "custom objects" on a canvas, which sounds more like custom painting using Java2D rather than making use of widgets. For a widget-based UI, I think you're right on the money suggesting Swing. For painting custom objects, you're going to be using classes in the java.awt.* package.
  • Re:Easy Choice (Score:1, Informative)

    by Anonymous Coward on Sunday November 28, 2010 @02:06AM (#34362792)

    Glad someone finally mentioned this. You can write one app and have something that works in every major browser and as a desktop application on every major platform, including Android and iPhone. With Flex, you have a very fast path to application GUI development, and with the integration with the rest of the Creative Suite apps you have arguably the best overall set of design tools. AS3 is a solid OOP language to work with. It lacks some of the features of Java and C# (while having a few they don't), but it's great for writing event-driven applications and for working with XML. Of course, Adobe Air doesn't qualify if you need 2D GPU acceleration (and for 3D DirectX/OpenGL support we have to wait until next year).

  • by coaxial ( 28297 ) on Sunday November 28, 2010 @02:14AM (#34362818) Homepage

    OpenGL? "Lightweight"? Sure, I suppose because it's all implemented in the system, you don't have to redistribute much, but have you actually ever written anything remotely complicated in raw OpenGL? For anything resembling a GUI, the poster is going to spend months of writing low-level code that's been done a thousand times already.

    Wha? GLUT [wikipedia.org] and GLUI [wikipedia.org] don't exist? Sure they're ugly as hell, but that's a different story.

  • Re:Qt has flaws (Score:2, Informative)

    by wssddc ( 450574 ) on Sunday November 28, 2010 @02:49AM (#34362912) Homepage

    I also don't know where you got the idea that the VS plugin works only with paid versions. It works fine with the LGPL plugin for me.

    It's a paid version of Visual Studio that is needed. The plugin refuses to install if you only have the free VS Express.

  • Re:The answer (Score:5, Informative)

    by TeXMaster ( 593524 ) on Sunday November 28, 2010 @04:07AM (#34363060)
    My kingdom for a mod point!

    (For those that missed the reference, this is it [youtube.com])

  • by Anonymous Coward on Sunday November 28, 2010 @04:22AM (#34363096)

    Now draw a circle.

    glPointSize(10);
    glColor3f(1.0f, 1.0f, 1.0f);
    float point[2] = {0.0, 0.0};
    glVertexPointer(2, GL_FLOAT, 0, point);
    glDrawArrays(GL_POINTS, 0, 1);

    Now draw a bezier curve.

    float lines[numberOfLines] = {0.0, 0.0, .......}
    glVertexPointer(2, GL_POINTS, 0, lines);
    glDrawArrays(GL_LINES, 0, numberOfLines);

    Now draw a circular gradient.

    uniform vec2 center;
    uniform vec4 innerColor;
    uniform vec4 outerColor;
    uniform float radius;

    void main()
    {
            float dis = distance(center, gl_FragCoord.xy);
            if (dis > radius);
                    gl_FragColor = outerColor;
            else
                    gl_FragColor = dis/radius*outerColor + (radius - dis)/radius*innerColor;
    }

    Now draw a button with the text "OK" on it.

    NSFont *font = [NSFont fontWithName:@"Helvetica" size:18.0f];
    NSDictionary *fontAttributes = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, [NSColor whiteColor], NSForegroundColorAttributeName, [NSColor blackColor], NSBackGroundAttributeName, nil];

    NSAttributedString *string = [[NSAttributedString alloc] initWithString:@"OK" attributes:fontAttributes];

    NSImage *image = [[NSImage alloc] initWithSize:string.size];
    [image lockFocus];
    [string drawAtPoint:NSMakePoint(0.0f, 0.0f)];
    NSBitmapImageRep *bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect:NSMakeRect(0.0f, 0.0f, image.size.width, image.size.height)];
    [image unlockFocus];

    GLint button;
    glEnable(GL_TEXTURE_RECTANGLE_ARB);
    glGenTextures(1, &button);
    glBindTexture(GL_TEXTURE_RECTANGLE_ARB, button);
    glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, bitmap.size.wigth, bitmap.size.height, 0, GL_RGBA, GL_UNSIGNED_BYTE, [bitmap bitmapData]);

    float rectangle[8] = {0.0, 0.0, 0.0, bitmap.size.height, .....} // Make the button what ever shape you want.

    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glVertexPointer(2, GL_FLOAT, 0, rectangle);
    glTexCoordPointer(2, GL_FLOAT, 0, rectangle);
    glDrawArrays(GL_QUADS, 0, 4);

    [font release];
    [fontAttributes release];
    [string release];
    [image release];
    [bitmap release];

    Doing this all in OpenGL then makes it dead simples to animate and tranform and move around the screen.

  • by okoskimi ( 878708 ) on Sunday November 28, 2010 @04:59AM (#34363198)
    Qt has recently introduced Qt Quick [nokia.com], a collection of technologies meant to help you create animation-rich UIs similar to those used on touch phones. The most important part is the QML language [nokia.com], which is used to describe the user interface of a program. QML is declarative and animation-friendly, and makes it easy to create fluid interfaces. On the downside, it is not mature yet and lacks most of the standard UI widgets at the moment (basically, you have text input and clickable areas). I wouldn't have recommended it for general application writing just yet, but the original question was not very specific on the requirements so it might be suitable already in its current form.
  • Re:Qt (Score:3, Informative)

    by Anonymous Coward on Sunday November 28, 2010 @07:46AM (#34363586)

    Please don't mod this informative, the GP's interpretation is correct.

    > http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License#Differences_from_the_GPL

  • Re:Qt (Score:2, Informative)

    by ByteSlicer ( 735276 ) on Sunday November 28, 2010 @08:16AM (#34363686)
    Have you actually read it?

    5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.

    So linking to the QT dynamic libraries does not put any restrictions on your own program. You are however still required to distribute the QT parts as specified by the LGPL (provide the code and such).
    Only when using static linking will your code be a derived work, and be bound by the same license.

  • by g4b ( 956118 ) on Sunday November 28, 2010 @09:52AM (#34364144) Homepage

    You could use Googles GWT to write your GUI, and simply display a webkit window in the application, making it server-client friendly and usable via browser if needed.

    GWT is fairly cool and very advanced. You write stuff in Java, and it is translated to browser specific javascripts.

    However, I would still use Qt. For smaller projects I used wx already. PITA.

  • Re:Qt (Score:5, Informative)

    by ByteSlicer ( 735276 ) on Sunday November 28, 2010 @10:10AM (#34364238)
    Dynamic linking is certainly [qtcentre.org] possible with the QT libraries.
    Just because your C++ applications contains some function signatures, symbols and constants from the QT API doesn't make it a 'real' derived work, since this is using the library as intended.
    One part of LGPL section 5 states this:

    If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work.

    On the GNU website you can find the official standpoint [gnu.org] on this matter.

  • by BotnetZombie ( 1174935 ) on Sunday November 28, 2010 @10:33AM (#34364364)
    Good post, just wanted to add that there are bindings for Java available, see here [sourceforge.net]
  • by frodo from middle ea ( 602941 ) on Sunday November 28, 2010 @10:58AM (#34364510) Homepage
    About the only downside is that there aren't current C# or Java bindings for it.

    Umm... Qtjambi [sourceforge.net] (QT's Java bindings) has been available for ages, although recently Nokia transferred the ownership to community, but from the looks of it, the community is very active and the releases are on track.

  • by Bent Spoke ( 972429 ) on Sunday November 28, 2010 @03:20PM (#34366600)

    Beyond basic Tcl/Tk, you might look at Wize [pdqi.com], which includes 3 canvas options:

    • Canvas: with image tiling support added
    • Tkpath: Canvas based on SVG (backends Cairo, GDI, CoreGraphics)
    • Canvas3d: for OpenGL (not relevant here)

    Wize is under BSD licence, has minimal dependencies and offers pre-builts for Linux-i386 and Windows.

    Disclaimer: I am a Wize developer

  • by caseih ( 160668 ) on Sunday November 28, 2010 @03:43PM (#34366848)

    GTK+ is certainly weaker on the Windows and Mac side than Qt. But as far as speed and ease of coding, GTK+ is right up there. GTK++ is a great binding for C++, and PyGTK is quite good too. Writing Qt GUIs in PyQT is okay, but it's essentially the same as writing C++ code. In fact, it is the bindings where Qt is the weakest and where GTK+ is a bit better. Qt is written in C++ using the C++ object model and all it's features and warts. This does not always translate very well to other languages. A few years ago all Qt bindings for other languages were based on the QtC bindings because of this. Now Qt bindings are better. But GTK+, being based on a much simpler object model (the GOject) is very easy to wrap in C++, Perl, Python, Ruby, etc. PyGTK is one of the more comfortable toolkits to develop in and feels more at home in Python than Qt (PyQT; never have used pyside).

    GTK+ is hardly the "grave danger" the parent claims. For a lot of things it is a very nice toolkit to develop in. And the parent's statements on Tk are are not quite accurate. Tk is still alive and well, and looks reasonable in the modern incarnations on the big 3 platforms. It seems a bit daft to me to embed another entire language in my program (tcl) but sometimes that just might be the easiest. Many little utilities written in Python still use Tk. It's fast, easy, and always there if Python is there.

  • Re:AWT or OpenGL (Score:3, Informative)

    by peppepz ( 1311345 ) on Sunday November 28, 2010 @04:53PM (#34367652)

    Swing's API is just horrible.

    Swing's API is not bad. It allows you to create a working mirrored, 35-rotated radio button with three lines of code. It's true that built-in layout managers suck, but BoxLayout is almost usable. And if you don't like them, then don't use them at all, and fall back to absolute positioning, which is what most other toolkits do anyway. Moreover, the original poster didn't require a widget toolkit, but rather a 2D graphics API.

    For example, why the hell does java.awt.Graphics.drawRectangle() not accept a java.awt.Rectangle as a parameter?

    Graphics.drawRectangle() does not exist. Are you talking about Graphics.drawRect()? It's a legacy API from Java 1.0 which was intended to run on machines where the overhead of converting coordinates into a heap-allocated Rectangle structure could be significant.
    Instead you should use Graphics2D.draw(), which consistently supports any Shape, including a Rectangle. It also supports floating point coodinates, transforms, etc. Please update your trolling to 2005, thank you.

    I do still agree that Java is one of the better choices for cross-platform GUI building, by virtue of not being overcomplicated and error-prone like C++ or unbearably slow like Python; but if this is the best we can do, I weep for the future of the human race.

    Instead, in my opinion Java2D is the most elegant, intuitive and powerful 2D "canvas" API I've ever used. For example, it allows you, with a few lines of code, to load an OpenType font, format a string using it, and convert it to a Shape which can be rendered using the current stroke and fill properties. Any step of the process can be customized using the same API: you can break the string in lines using a layout, you can iterate the vertices of the resulting Shape, you can apply transforms and clipping, the usual Porter-Duff composition, and you can control the rasterization from Shapes into pixels. All of this implemented mostly in pure Java, with fully commented source code available, and it's available out of the box in all Java implementations.

    Tutorial [oracle.com].

  • Re:More information (Score:3, Informative)

    by Zmee ( 806851 ) on Sunday November 28, 2010 @08:10PM (#34369318)

    Original poster here. I am looking to implement a customized card game (think Magic [wizards.com] or Yu-Gi-Oh [yugioh-card.com]). This is my step-son's first foray into development, and my first UI requiring any custom controls. (I have done a fair bit of ASP.NET, PHP, and Windows Forms, but most of that is not applicable given what I am planning here). The idea is to be able to create the card images from a combination of stored bitmaps, text, and some general backgrounds. As such, much of the GUI will be vectored, but some must be raster (ie the bitmaps). Note that given the general structure, framerate is not a high consideration.

    Note that I have not ruled out a HTML 5 UI and if I went with Java AWT, I may wrap it as an applet. I would certainly like to stay away from Flash (& am leaning against Java for similar reasons), but have not ruled that out either.

  • by SplashMyBandit ( 1543257 ) on Sunday November 28, 2010 @09:39PM (#34370154)

    Except that JavaFX is less powerful than Swing. They're meant for different purposes.

    One (JavaFX) is simplified and really intended for the web and web developers who can get away with less complex interfaces (since the expectations for interactivity on the web are so low compared with expectations on the desktop). The default set of controls for JavaFX have even more omissions than the default set for Swing (which both SwingLabs and the marketplace make up for fortunately).

    On the other hand Swing is comprehensive and powerful. It is too much for many, but if you know how to wrangle it there is no substitute. If you want to *deeply* customize your controls you have the power to do so (many frameworks, eg SWT, WinForms etc have nice defaults, but once you start trying to extend them it gets very painful - moreso than Swing in my experience). I understand many hate Swing because of it's complexity or it doesn't work exactly as the Win32/WPF APIs do, but for me personally it is brilliant for multi-platform work and not yet found anything else that can touch it for sheer flexibility and customization.

    So, while JavaFX is an option I don't think it is a generic solution to all classes of GUI problems (if you are going to invest time, effort and money you might as well use a 'swiss-army' toolkit that can apply to many problems).

  • Re:Swing + Java2D (Score:4, Informative)

    by SplashMyBandit ( 1543257 ) on Sunday November 28, 2010 @09:58PM (#34370298)

    Incorrect on both counts.

    Swing was designed to use a minimal amount of AWT (to set up a rendering contents and basic window and event management). Most of AWT is deliberately not used by Swing to reduce platform-specific issues (nb. one of the reasons Swing was invented was to bypass the limitations of AWT). Swing renders using Java2D rather than the native widget rendering of AWT.

    The "Java2D is AWT" statement is incorrect. Java2D used to be a software library for rendering to a context. It is now fully hardware accelerated via DirectX or OpenGL shaders (depending on the host platform and pipeline selected). AWT includes Java2D but also a whole bunch of other stuff for window management, host system interaction, event management, input management etc etc. So, AWT includes Java2D but it is *not* the same as Java2D.

    Does that clarify it enough so you can see the inaccuracy in your statements?

"Experience has proved that some people indeed know everything." -- Russell Baker

Working...