Results 1 to 2 of 2
Thread: Help needed with Swing
- 01-06-2014, 01:33 PM #1Senior Member
- Join Date
- Nov 2012
- Rep Power
Help needed with Swing
Hello, I am working on a project using Swing/AWT, but the app has a complicated logic. The source is huge but I`ll describe in short:
I have QQuestion which extends JPanel, and has JTextArea, and 2 JButtons ( 1 for forward and 1 for backwad )
I have a QADList class which does not extends anything but containst an array of QQuestion(s) and manipulates another class MainApp which extends JFrame.
So... the task is a quiz based app. The idea is that you can`t use the back buttons more than 1 time. The second time you press a back button, a new QErrorFrame class will be fired ( gaining focus and forces you to press the error frame button which updates you to next question ).
What I did:
In QADList I follow a simple logic for removing from the list question[index] and adding question[index++] or index-- , it works so I`ll spare the details. Then I revalidate() and repaint(), but NEVER null the QQuestion classes. So if I have 20 QADLists then there will be 80 QQuestions. My QErrorFrame works as expected. So here is the problem:
The client needs a timer error message :( When I waint 2 min - the error message will be displayed ( similar to QErrorMessage ) with button and update foward porperties. I`ve tried with Timer class some code but I still gain ugly bugs like splitting the frame in 2, does not update, etc. Requirement is that only one error frame is present, be that from button click or from timer. The problem is that they collide the ugly way. I`ve removed the collision by adding additional boolean variables and set a common logic. Somehow my logic fails me or the GUI is unstable for such operation. Any good suggestion or idea how to make the countdown warning and the button click error? They can`t be both on screen. Sorry that I can`t show you code since the whole source must be pasted to make some logic ( only QADList class is 300+ lines ). Hope to give me a good advice.
- 01-06-2014, 04:56 PM #2
- By IngeniumR in forum Jobs OfferedReplies: 0Last Post: 02-05-2013, 01:17 PM
- By steve in forum Jobs OfferedReplies: 0Last Post: 01-29-2013, 08:32 PM
- By cyberdesi in forum AWT / SwingReplies: 2Last Post: 08-20-2010, 12:45 AM
- By pbracey in forum Jobs OfferedReplies: 0Last Post: 07-19-2010, 10:25 PM
- By elizabeth in forum New To JavaReplies: 1Last Post: 07-30-2007, 07:02 PM