Skip to main content

Questions tagged [swing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
322 views

How does the MVC pattern actually work?

I’m still a Computer Science student, and recently I’ve had to develop a project using the MVC pattern, but without having learned in depth about how it actually works. And it’s not the first time I’...
MasterTJ123's user avatar
0 votes
1 answer
199 views

Exception handling with failure atomicity in desktop applications

When it comes to exception handling, there are many guidelines and best practices on the web. On of them is to throw early, catch late, or even Don't Catch. So when facing an exception, the current ...
mperktold's user avatar
  • 151
2 votes
2 answers
372 views

MVC: Should my domain model look like this?

Consider the following GUI screen (Java Swing) with a list of persons where the user can select a person and delete it. According to MVC, the view observes (observer pattern) the model and updates ...
George Z.'s user avatar
  • 705
2 votes
1 answer
119 views

How to properly model an MVC model in this case?

I aim to understand pull model MVC. I'm stuck at defining a model for a simple color-guessing game in Java Swing I chose to practice it. I borrowed the model's initial version from an example which ...
Piovezan's user avatar
  • 481
1 vote
1 answer
263 views

Controller class for an input dialog

I am learning OOP, concretely Java, by developing a real life business application for aimed for repair shops. I have followed MVC pattern design for GUI elements of my application. I was wondering do ...
Zoran Jankov's user avatar
-2 votes
1 answer
114 views

How can I transfer a users information in a dashboard page after he/she logs in?

I am developing a Bank Management Project. Now I am stuck in a point. I want to create a login page where a user will submit his/her username and password then after clicks on the login button, a new ...
Shahparan Rifat's user avatar
-3 votes
1 answer
256 views

Java swing debugging [closed]

I have programmed a Java Swing application. I have some bugs in my program and I want to discover where in the code these errors occurs. With normal code (Non-GUI related code) I apply debugging for ...
jennifer ruurs's user avatar
-3 votes
2 answers
114 views

Determine image value by image name

I'm making a blackjack game, and I want to take my cards images and give each a value for the game. I'm not sure how to determine their value. Should I just do a big switch statement with all the ...
heapoverflow's user avatar
1 vote
1 answer
543 views

How to quickly present 1000s of pictures in a jlist

I need people opinions on how to improve a code I've written. Let's assume we have an application cataloging movies (~3500 of them) and actors (~1000, but I need to double-check this). Both actors ...
Sandrew Cheru's user avatar
-1 votes
1 answer
782 views

MVC with several MVC-patterns and gameloop

I made a small program using several MVC-patterns. So far I havnt got to much stuff to put in the model so I havnt got any model yet. My idea is to make one MVC pattern for each panel. And looping ...
acroscene's user avatar
  • 119
10 votes
3 answers
34k views

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 ...
Rick's user avatar
  • 213
9 votes
5 answers
9k views

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 ...
Lewis Briffa's user avatar
0 votes
1 answer
982 views

Architecture for my Java application [closed]

I try to create small Java tools to help me at my work every now and then. Usually these do not have to be pretty and I find myself coding a single, sometimes massive, Java class. However, now my plan ...
treiman's user avatar
0 votes
1 answer
215 views

Adding a graphical view to a system

I currently have an program in Java that simulates railway movements. Essentially, trains arrive on platforms, pick up and drop off passengers, and then proceed, respecting signalling where possible. ...
Samuel Front's user avatar
5 votes
1 answer
12k views

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; ...
overexchange's user avatar
  • 2,305
4 votes
1 answer
899 views

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 ...
overexchange's user avatar
  • 2,305
3 votes
0 answers
2k views

How to pass control between sub-controller to parent controller in Java MVC Design Pattern?

I'm pretty new in Java, but I've done plenty of research and I know what MVC is. However, to implement MVC in Java was a difficult task. I followed this tutorial, which helped me to realise that the ...
user3804927's user avatar
5 votes
2 answers
807 views

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 ...
Bernard Igiri's user avatar
0 votes
1 answer
79 views

Is it fine for a class that creates objects to delegate them?

I have a large list of intercommunicating components; so I decided to have one class create all of them and then subsequently delegate them to other classes to facilitate finer tweaking and wiring ...
user2738698's user avatar
1 vote
2 answers
1k views

How to manage data flow between UI components?

I have been trying to use classes that implement ActionListener to respond to user input. I'm consistently noticing that for an action listener to communicate the event to other objects, it has to ...
user2738698's user avatar
0 votes
1 answer
208 views

Is it fine to skip MVC?

I am building a pair of components that communicates in a one-way fashion: [ JButton ] --> data...process...process...out --> [ JTextField ] The JButton allows the user to select a file and ...
user2738698's user avatar
0 votes
1 answer
157 views

Where to put variables needed across classes?

I have 3 classes: a JButton extension, FButton; a JTextField; and a JPanel extension, FPanel, that would contain one instance of both. The FButton is supposed to open a file, and make the file name ...
user2738698's user avatar
2 votes
2 answers
973 views

Is there a way to not use the Observer pattern when creating GUI systems?

In Java, the Swing library implements the Observer/Subscriber-Publisher design pattern to design the way the program responds to events on the GUI (button clicks, etc). The programmer registers ...
Aviv Cohn's user avatar
  • 21.5k
4 votes
1 answer
13k views

Do threads delete themselves?

Let's say I was working on a Swing application. Most of it is run on the EDT using SwingUtilities.invokeLater() inside the main method, because I heard (please correct me if I'm wrong) that that's ...
Aviv Cohn's user avatar
  • 21.5k
1 vote
3 answers
325 views

GUI programming - who should be an owner

I know nothing about gui programming. I try to learn. I have simple question... For example, I have small program. I have class that extends JFrame with main Window (MyWindowClass) and my "logic" ...
pawell55555's user avatar
1 vote
3 answers
3k views

How can I write complex validation and business logic that can be reused in both direct data model changes and pending dialog changes?

I was hoping for some advice: I need to design a software solution for a medium-sized java / Swing application. The application will have about 200 use cases requiring complex data validation and ...
user111347's user avatar
-1 votes
1 answer
299 views

Help in (re)designing my Swing application [closed]

I have developed a Swing application that controls execution of several scripts like jobs. I need to display the interim output of the jobs concurrently. I have followed MVC while writing the ...
Harihar Das's user avatar
0 votes
1 answer
3k views

How to manage a lot of Action Listeners for multiple buttons

I have this Tic Tac Toe game and I thought of this really cool way to draw out the grid of 9 little boxes. I was thinking of putting buttons in each of those boxes. How should I give each button (9 ...
Wumbo4Dayz's user avatar
2 votes
3 answers
2k views

Animation in Swing

I have a project written using Swing, and I want to make it more smoothly (like JavaFX is) by adding animation to some components(JButton, JScrollPane, JSplitPane) using javax.swing.Timer. UPD: That ...
SeniorJD's user avatar
  • 123
5 votes
2 answers
3k views

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 ...
coolig's user avatar
  • 53
3 votes
3 answers
3k views

Why doesn't Swing look native out of the box?

Java Swing GUI's don't look native by default (Except on Mac OS X for some reason). Swing uses it's own look and feel. You can get Swing to use the system look and feel by putting: javax.swing....
jobukkit's user avatar
  • 217
3 votes
3 answers
356 views

MVC seems to create dependencies that just "don't feel right"

I might be misunderstanding MVC, so forgive me if that is the case. This is my program structure (Java/Swing): I have a JTable (View) that is pointed to by a custom linked list (Model). When the user ...
sinθ's user avatar
  • 1,311
2 votes
1 answer
453 views

Criteria for selecting MigLayout for GUI code?

It seems to be easier to use and more feature rich than standard swing layouts. It looks like a do it all replacement for all standard layouts. If you are making simple code to just show the time in a ...
david blaine's user avatar
1 vote
1 answer
428 views

Java Swing ActionListener design

I have a form that includes an area for putting in address information and a table that shows the addresses that have been added. I've separated out the ActionListener for the "add address" button on ...
Zack Macomber's user avatar
2 votes
1 answer
1k views

How to debug through a swing based application effectively

I am trying to understand how a radio button is created in a Dynamic field by reading from an XML using Netbeans 7.0. I know the radio button is created because of the XML being read from database, ...
Nigel Thomas's user avatar
3 votes
8 answers
15k views

Frustration with Java Swing layout managers

I have been trying for years to master Swing layout managers with no success. Every time I need to do something with Swing, it is like pulling nails to get the visual components to line up the way I ...
amphibient's user avatar
  • 1,591
11 votes
3 answers
14k views

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 ...
egor's user avatar
  • 121
2 votes
1 answer
128 views

Statistics for and Details About Open Source Swing Projects

I'm looking for process-relative information on open-source Swing projects: how the task was described how many developers were involved how much time the solution was taken etc. Are there any open ...
user592704's user avatar
27 votes
1 answer
8k views

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 / ...
Cedric Martin's user avatar
14 votes
8 answers
14k views

Do you start migrating your Swing project to JavaFX [closed]

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 ...
Cheok Yan Cheng's user avatar
2 votes
1 answer
201 views

Separating model from UI

I have a Swing application with a custom TreeModel that can refer to domain instances. I'm wondering what changes I could make if I consider moving to a web interface later on. Would a pluggable model ...
James P.'s user avatar
  • 1,223
0 votes
1 answer
789 views

what is Docking Framework

I searching for undestanding Docking Framework concept in web, but I don't understand its concept and benefit. I see exist several 'Docking Framework' in java such as Netbeans Platform or MyDoggy or ...
Sam's user avatar
  • 201
4 votes
1 answer
2k views

Opensource showcase for MVC in Java Swing [closed]

I've allready created small desktop CRUD applications using Java/Swing. In hindsight I'm not quite sure if the overall design of these applications is good. I've also done some reading on MVC and ...
Regular John's user avatar
4 votes
3 answers
8k views

Advantage of using Swing over AWT [closed]

Why is Swing preferred over AWT? Which Swing component could be used for playing a video on it?
Mohammad Faisal's user avatar
9 votes
2 answers
363 views

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 ...
Destroyica's user avatar
10 votes
2 answers
15k views

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 ...
Chap's user avatar
  • 733
1 vote
3 answers
3k views

Is anybody using JavaFX

I'm very tempted to use it purely because of its neat Binding APIs, and now that you're able to use it in conjunction with Swing it feels like a natural progression. The only thing that I can seem ...
Tim Sparg's user avatar
  • 203
12 votes
5 answers
2k views

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 ...
devoured elysium's user avatar
3 votes
3 answers
13k views

What is good programming practice for structuring java project?

I have a Java project that is getting to be relatively large (a few thousand lines in all, I'd say). It's definitely a lot larger than what I've dealt with before, being that I am still a relatively ...
user avatar
2 votes
5 answers
487 views

Senior project environment selection

My 2 friends and I are preparing our senior project idea for next year. I need some of different ideas while deciding the base environment of the project, especially from software developers/engineers ...
Seregwethrin's user avatar