Questions tagged [swing]

54 questions
27
votes
1 answer

Is shipping a Clojure desktop app realistic?

I'm currently shipping a desktop Java application. It is a plain old Java 5 Java / Swing app and so far everything worked nicely. Java 5 was targetted because some users were on OS X version / computers that shall never have Java 6 (we may lift this…
Cedric Martin
  • 1,067
  • 10
  • 16
18
votes
2 answers

What are the best practices of Java Swing development?

While doing my pre-research for this question, I found that there isn't much well-organized information about Java Swing best practices out there on the Internet. So I figure I'll give Stack Exchange a shot at building that One Great List. What are…
Pops
  • 4,093
  • 4
  • 28
  • 41
14
votes
8 answers

Do you start migrating your Swing project to JavaFX

I have a 4 years old project which is written in Swing + SwingX. Currently, it is still alive and still kicking. However, as more GUI related feature requests coming in (For instance, a sortable tree table), I start to feel the difficulty in fulling…
Cheok Yan Cheng
  • 462
  • 2
  • 4
  • 11
12
votes
5 answers

Why do Windows Forms / Swing frameworks favour inheritance instead of Composition?

Today a professor of mine commented that he found it odd that while SWT's philosophy is one of making your own controls by composition, Swing seems to favour inheritance. I have almost no contact with both frameworks, but from what I remember in…
devoured elysium
  • 592
  • 1
  • 5
  • 17
11
votes
3 answers

What drawbacks does Java Swing GUI framework have?

I have used Java Swing for some desktop applications. But I haven't used other GUI frameworks that much so I can't compare them. There is definitely some things that I like with Swing and some that I don't like, but that is the situation with almost…
Jonas
  • 14,867
  • 9
  • 69
  • 102
11
votes
3 answers

Using MVC in a Java app

I need to write a cross-platform GUI application to process (in multiple threads) and visualize fairly large quantities of data. Ideally the application should be relatively fast and look good. The app's interface will consist of a table widget, a…
egor
  • 121
  • 1
  • 1
  • 5
10
votes
2 answers

How to completely decouple Model from View/Controller in Java Swing

Is there a collection of commonly-agreed-upon design guidelines for separating the Model classes from the View/Controller classes in a Java Swing app? I'm not so concerned that the View/Controller know nothing about the Model as the other way…
Chap
  • 723
  • 1
  • 7
  • 18
10
votes
2 answers

Need advice on designing interactions between various parts of my application

I'm trying to design the "main" classe(s) of a Rich Desktop Application based on NetBeans Platform 7. This application will consume HTTP services and, through a "push system" over TCP, will receive messages. We are 3 developpers and we want to…
Destroyica
  • 281
  • 3
  • 10
9
votes
3 answers

Design pattern for window management in a Java Swing app

I've just started creating my very first little Java Swing app. When the program opens, it brings up a single, simple window with a label and a couple buttons. Clicking one of those buttons is supposed to wipe out the welcome screen and replace it…
Pops
  • 4,093
  • 4
  • 28
  • 41
9
votes
3 answers

How to reduce size of jar file?

I dont know how to reduce the size of jar file. When we normally code in Java Swing the jar file is created, is there any way to reduce the size of jar file? I can't remove the images and other stuff which I have included as it's necessary. I tried…
Rick
  • 203
  • 1
  • 2
  • 7
9
votes
5 answers

How many classes are too many?

I'm making a Book Manager App using Java Swing that allows me to do a variety of things such as opening a txt list of books, searching for books, adding/removing books. There are different classes for the different types of books e.g. Fictional…
Lewis Briffa
  • 199
  • 1
  • 2
5
votes
1 answer

What is the advantage of 'SwingUtilities.invokeLater()' method?

For the below sample GUI program using javax.swing, public class UnResponsiveUI extends JFrame{ private boolean stop = false; private JTextField tfCount; private int count = 1; /* Constructor to setup the GUI…
overexchange
  • 2,245
  • 2
  • 17
  • 47
5
votes
2 answers

Does having many duplicated methods and deep inheritance hierarchies in GUI APIs (Java Swing, Android SDK) violate the SOLID design principles?

For those unfamiliar with the SOLID principles you can start reading here: Wikipedia article. However, most of my understanding comes from: http://www.objectmentor.com/resources/publishedArticles.html Regardless, it seems that every GUI interface I…
5
votes
2 answers

Publish/subscribe, observer pattern implementation question

I'm developing desktop application in java/swing. I have a component that is registered as a subscriber to many panels and gets messages (my custom event) from them. That component is something like message tray. When there is a validation error or…
coolig
  • 53
  • 1
  • 6
4
votes
1 answer

Why 'JButton' is-a 'Container' in javax.swing?

As per the class hierarchy in java.awt.*, class Button & class Label is-a class Component, and Component is not a Container, which make sense to me. As per the redesign of class hierarchy in javax.swing.*, class JButton is-a class JComponent in-turn…
overexchange
  • 2,245
  • 2
  • 17
  • 47
1
2 3 4