Results 1 to 2 of 2
  1. #1
    heatblazer is offline Senior Member
    Join Date
    Nov 2012
    Rep Power

    Question 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.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Washington, DC
    Rep Power

    Default Re: Help needed with Swing

    For better help sooner, you should provide an SSCCE that demonstrates your problem in as few lines as possible.
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

Similar Threads

  1. Replies: 0
    Last Post: 02-05-2013, 02:17 PM
  2. Replies: 0
    Last Post: 01-29-2013, 09:32 PM
  3. Swing application advise needed
    By cyberdesi in forum AWT / Swing
    Replies: 2
    Last Post: 08-20-2010, 01:45 AM
  4. Replies: 0
    Last Post: 07-19-2010, 11:25 PM
  5. map javax.swing.text.Element to javax.swing.text.View
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 07-30-2007, 08:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts