Updating my GUI?

for my program i need to change the image of a JPanel to that which is set - once a user pushes a button
My paintComponent function has an if statement to check if image is null or to paint the set image yet when i pass in my image in a setImage function even when calling repaint() it doesnt update to the new image.
The Panel is within a Panel withing another Panel within the frame
any idea of how to update this to the new image correctly?
Thanks

PanelBorder class - where i want to draw the imsge to, a bit messy jsut now cause im experimenting alot with the program
public class PanelBorder extends JLabel{
     private final int cardHeight = 40;
     private final int cardWidth = 30;
     private Image card;
     public void setImage(Image image){
          this.card = image;
          this.repaint();
     public PanelBorder(){
          card = null;
          this.setPreferredSize(new Dimension(cardWidth + 5,cardHeight+10));
     public PanelBorder(Image image){
          this.card = image;
          this.setPreferredSize(new Dimension(cardWidth,cardHeight));
     public Image getImage(){
          return card;
     public void draw(){
          repaint();
     public void paintComponent(Graphics g){
          super.paintComponent(g);
          if(card == null){
               g.setColor(Color.black);
               g.drawRect(0, 0, cardWidth, cardHeight);
          if(card != null){
               g.drawImage(getImage(),0,0,null);
}When the user presses a button i need it to update so:
public void UpdateCards(String letter,String number){
           cards[0].setImage(ImageLoader.get().getCard(letter, number));
      }is in the view class (my panels are stored in an array)
Hope this helps more :)

Similar Messages

  • Updating a GUI component from a runnable class that doesn't know that GUI

    Hi. I have a problem that I think isn't solvable in an elegant way, but I'd like to get confirmation before I do it the dirty way.
    My application allows the user to save (and load) his work in sessions files. I implemented this by a serializable class "Session" that basically stores all the information that the user created or the settings he made in its member variables.
    Now, I obviously want the session files created by this to be as small as possible and therefore I made sure that no GUI components are stored in this class.
    When the user has made all his settings, he can basically "run" his project, which may last for a long time (minutes, hours or days, depending on what the user wants to do....). Therefore I need to update the GUI with information on the progress/outcome of the running project. This is not just a matter of updating one single GUI component, but of a dynamic number of different internal frames and panels. So I'd need a reference to a GUI component that knows all these subcomponents to run a method that does the update work.
    How do I do that? I cannot pass the reference to that component through the method's argument that "runs" the project, because that needs to be a seperate thread, meaning that the method is just the run() method of that thread which has no arguments (which I cannot modify if I'm not mistaken).
    So the only thing I can think of is passing the reference through the constructor of the runnable class (which in turn must be stored in the session because it contains critical information on the user's work). As a result, all components that need to be incorporated in that updating process would be part of the session and go into the exported file, which is exactly what I wanted to avoid.
    I hope this description makes sense...
    Thanks in advance!

    Thanks for the quick answer! Though to be honest I am not sure how it relates to my question. Which is probably my fault rather than yours :-)
    But sometimes all it takes me to solve my problem is posting it to a forum and reading it through again :)
    Now I wrote a seperate class "Runner" that extends thread and has the gui components as members (passed through its constructor). I create and start() that object in the run method of the original runnable class (which isn't runnable anymore) so I can pass the gui component reference through that run method's argument.
    Not sure if this is elegant, but at least it allows me to avoid saving gui components to the session file :-)
    I am realizing that probably this post shouldn't have gone into the swing forum...

  • Updating the GUI from a background Thread: Platform.Runlater() Vs Tasks

    Hi Everyone,
    Hereby I would like to ask if anyone can enlighten me on the best practice for concurency with JAVAFX2. More precisely, if one has to update a Gui from a background Thread what should be the appropriate approach.
    I further explain my though:
    I have window with a text box in it and i receive some message on my network on the background, hence i want to update the scrolling textbox of my window with the incoming message. In that scenario what is the best appraoch.
    1- Shall i implement my my message receiver as thread in which i would then use a platform.RunLater() ?
    2- Or shall i use a Task ? In that case, which public property of the task shall take the message that i receive ? Are property of the task only those already defined, or any public property defined in subclass can be used to be binded in the graphical thread ?
    In general i would like to understand, what is the logic behind each method ?
    My understanding here, is that task property are only meant to update the gui with respect to the status of the task. However updating the Gui about information of change that have occured on the data model, requires Platform.RunLater to be used.
    Edited by: 987669 on Feb 12, 2013 12:12 PM

    Shall i implement my my message receiver as thread in which i would then use a platform.RunLater() ?Yes.
    Or shall i use a Task ?No.
    what is the logic behind each method?A general rule of thumb:
    a) If the operation is initiated by the client (e.g. fetch data from a server), use a Task for a one-off process (or a Service for a repeated process):
    - the extra facilities of a Task such as easier implementation of thread safety, work done and message properties, etc. are usually needed in this case.
    b) If the operation is initiated by the server (e.g. push data to the client), use Platform.runLater:
    - spin up a standard thread to listen for data (your network communication library will probably do this anyway) and to communicate results back to your UI.
    - likely you don't need the additional overhead and facilities of a Task in this case.
    Tasks and Platform.runLater are not mutually exclusive. For example if you want to update your GUI based on a partial result from an in-process task, then you can create the task and in the Task's call method, use a Platform.runLater to update the GUI as the task is executing. That's kind of a more advanced use-case and is documented in the Task documentation as "A Task Which Returns Partial Results" http://docs.oracle.com/javafx/2/api/javafx/concurrent/Task.html

  • What is the best way to get another object's method to update my GUI?

    package stuff;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class Test extends JFrame{
      private static JButton ProcessButton = new JButton();
      private static JLabel jLabel2 = new JLabel();
      public static void main( String args []){
         Test f = new Test();
         f.setSize(500,500);
         Container c = f.getContentPane();
         ProcessButton.addActionListener( new ActionListener(){
                                     public void actionPerformed(ActionEvent e) {
                                        jLabel2.setText("Connecting to DB");
                                        //Connection connection = Tools.setUpConnectionToDB(url,userName,pwd);
         c.add(ProcessButton, BorderLayout.NORTH);
         jLabel2.setText("My Label");
         c.add(jLabel2, BorderLayout.SOUTH);
         f.setVisible(true);
    {\code]
    The method setUpConnectionToDB can take 1 - 10 mins to complete. By this time a user will prob have quit my app thinking
    it's crashed because it doesn't update the GUI with a progress status. :(
    What is the best way to get this method to update the GUI of the app which calls it?
    Something like  Connection connection = Tools.setUpConnectionToDB(url,userName,pwd, this);
    ie this being a reference to the GUI's JFrame is what I'm trying to use?

    A handy class to know about but not really what I'm after.
    I need the method call
    Tools.setUpConnectionToDB(url,userName,pwd);
    to be able to update a component ( The JLabel ) on the GUI
    Connection connection = Tools.setUpConnectionToDB(url,userName,pwd, this);
    [\code]
    method defn:public static Connection setUpConnectionToDB( String url, String user, String pwd, JFrame f ){
    //Why doesn't this code below modify the GUI on the calling App?
    f.jLabel2.setText("Setting UP DB Connection");
    f.repaint();
    Connection c = null;
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    c = DriverManager.getConnection(url,user,pwd);
    catch(ClassNotFoundException e){
    JOptionPane.showMessageDialog(null , "Error loading DB driver");
    System.exit(0);
    catch(Exception e){
    JOptionPane.showMessageDialog(null , "Error connecting to DB, check config file");
    System.exit(0);
    return c;
    }[\code]

  • How to update a GUI

    In the code below, how do I update the GUI with the random number that is generated? I cannot use a static method because I may need multiple instances of the GUI and each instance needs to have it's own unique output displayed. I can't combine the two class together because I want to serialize the Controller but NOT the GUI.
    public class Controller{
         public void makeNums(){
              // creates random numbers at random times
    public class Gui{
         private Controller control;
         public Gui(Controller control){
              this.control = control;
              openGui();                  // this method creates all the components of the GUI
              control.makeNums();
    }How can the Controller update the GUI after the random number has been generated?

    SquareBox wrote:
    DrClap wrote:
    It's pretty trivial:Thanks. I will give that a try. Just one final question here. Is it dangerous to use "this" in the Constructor? Thanks so much for the tip. I will give it a try right now.It's generally a bad idea to let the "this" reference escape from the c'tor before the object is fully initialized. You don't want some other class or method to be using your object before it's in a fully valid state. In this case, however, the object in question has already been fully initialized before you leak the reference, so you should be fine.
    Having said that, however, I'm not 100% sure that there's not a potential for memory inconsistency in a multithreaded context. I think in this particular case you're okay, but another approach might be to have an external method create the Gui and then call control.setGui(gui).

  • How do you monitor a background thread and update the GUI

    Hello,
    I have a thread which makes its output available on PipedInputStreams. I should like to have other threads monitor the input streams and update a JTextArea embedded in a JScrollPane using the append() method.
    According to the Swing tutorial, the JTextArea must be updated on the Event Dispatch Thread. When I use SwingUtilities.invokeLater () to run my monitor threads, the component is not redrawn until the thread exits, so you don't see the progression. If I add a paint () method, the output is choppy and the scrollbar doesn't appear until the thread exits.
    Ironically, if I create and start new threads instead of using invokeLater(), I get the desired result.
    What is the correct architecture to accomplish my goal without violating Swing rules?
    Thanks,
    Brad
    Code follows:
    import java.lang.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SystemCommand implements Runnable
         private String[] command;
         private PipedOutputStream pipeout;
         private PipedOutputStream pipeerr;
         public SystemCommand ( String[] cmd )
              command = cmd;
              pipeout = null;
              pipeerr = null;
         public void run ()
              exec ();
         public void exec ()
              // --- Local class to redirect the process input stream to a piped output stream
              class OutputMonitor implements Runnable
                   InputStream is;
                   PipedOutputStream pout;
                   public OutputMonitor ( InputStream i, PipedOutputStream p )
                        is = i;
                        pout = p;
                   public void run ()
                        try
                             int inputChar;
                             for ( ;; )
                                  inputChar = is.read();
                                  if ( inputChar == -1 ) { break; }
                                  if ( pout == null )
                                       System.out.write ( inputChar );
                                  else
                                       pout.write ( inputChar );
                             if ( pout != null )
                                  pout.flush ();
                                  pout.close ();
                             else
                                  System.out.flush();
                        catch ( Exception e ) { e.printStackTrace (); }     
              try
                   Runtime r = Runtime.getRuntime ();
                   Process p = r.exec ( command );
                   OutputMonitor out = new OutputMonitor ( p.getInputStream (), pipeout );
                   OutputMonitor err = new OutputMonitor ( p.getErrorStream (), pipeerr );
                   Thread t1 = new Thread ( out );
                   Thread t2 = new Thread ( err );
                   t1.start ();
                   t2.start ();
                   //p.waitFor ();
              catch ( Exception e ) { e.printStackTrace (); }
         public PipedInputStream getInputStream () throws IOException
              pipeout = new PipedOutputStream ();
              return new PipedInputStream ( pipeout );
         public PipedInputStream getErrorStream () throws IOException
              pipeerr = new PipedOutputStream ();
              return new PipedInputStream ( pipeerr );
         public void execInThread ()
              Thread t = new Thread ( this );
              t.start ();
         public static JPanel getContentPane ( JTextArea ta )
              JPanel p = new JPanel ( new BorderLayout () );
              JPanel bottom = new JPanel ( new FlowLayout () );
              JButton button = new JButton ( "Exit" );
              button.addActionListener ( new ActionListener ( )
                                       public void actionPerformed ( ActionEvent e )
                                            System.exit ( 0 );
              bottom.add ( button );
              p.add ( new JScrollPane ( ta ), BorderLayout.CENTER );
              p.add ( bottom, BorderLayout.SOUTH );
              p.setPreferredSize ( new Dimension ( 640,480 ) );
              return p;
         public static void main ( String[] argv )
              // --- Local class to run on the event dispatch thread to update the Swing GUI
              class GuiUpdate implements Runnable
                   private PipedInputStream pin;
                   private PipedInputStream perr;
                   private JTextArea outputArea;
                   GuiUpdate ( JTextArea textArea, PipedInputStream in )
                        pin = in;
                        outputArea = textArea;
                   public void run ()
                        try
                             // --- Reads whole file before displaying...takes too long
                             //outputArea.read ( new InputStreamReader ( pin ), null );
                             BufferedReader r = new BufferedReader ( new InputStreamReader ( pin ) );
                             String line;
                             for ( ;; )
                                  line = r.readLine ();
                                  if ( line == null ) { break; }
                                  outputArea.append ( line + "\n" );
                                  // outputArea.paint ( outputArea.getGraphics());
                        catch ( Exception e ) { e.printStackTrace (); }
              // --- Create and realize the GUI
              JFrame f = new JFrame ( "Output Capture" );
              f.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
              JTextArea textOutput = new JTextArea ();
              f.getContentPane().add ( getContentPane ( textOutput ) );
              f.pack();
              f.show ();
              // --- Start the command and capture the output in the scrollable text area
              try
                   // --- Create the command and setup the pipes
                   SystemCommand s = new SystemCommand ( argv );
                   PipedInputStream stdout_pipe = s.getInputStream ();
                   PipedInputStream stderr_pipe = s.getErrorStream ();
                   // --- Launch
                   s.execInThread ( );
                   //s.exec ();
                   // --- Watch the results
                   SwingUtilities.invokeLater ( new GuiUpdate ( textOutput, stdout_pipe ) );
                   SwingUtilities.invokeLater ( new GuiUpdate ( textOutput, stderr_pipe ) );
                   //Thread t1 = new Thread ( new GuiUpdate ( textOutput, stdout_pipe ) );
                   //Thread t2 = new Thread ( new GuiUpdate ( textOutput, stderr_pipe ) );
                   //t1.start ();
                   //t2.start ();
              catch ( Exception e ) { e.printStackTrace (); }
              

    Thanks for pointing out the SwingWorker class. I didn't use it directly, but the documentation gave me some ideas that helped.
    Instead of using invokeLater on the long-running pipe-reader object, I run it on a normal thread and let it consume the output from the background thread that is running the system command. Inside the reader thread I create a tiny Runnable object for each line that is read from the pipe, and queue that object with invokeLater (), then yield() the reader thread.
    Seems like a lot of runnable objects, but it works ok.

  • Update JTable GUI

    hello,
    i'm stuck with a stupid prob. i initialize my table with some number of row and cols. but after user finishes their drwaings i would to update my table GUI depending upon no of node they'll draw. and also i want to update the row contents dynamically. how can i do that. pls help..............................
    thnx,
    ar

    i can update the table when i put on a frame but for my application i need to put the table on a panel I don't understand what you are saying and I can't guess what your code looks like so here's a working [url http://forum.java.sun.com/thread.jsp?forum=57&thread=418866]example of adding/removing columns.

  • Trouble updating a GUI interface - in SOS state

    hi there,
    I have some trouble implementing this GUI related code, but what it basically does is it removes the certain component of the jframe (removes one of jpanels) and attaches a newly created panel.....I posted up the same topic last night, and somebody provided me with helpful hint about using various methods in the class Component (ie Component.add, Component.remove, Component.validate, etc). I looked it up on the java.sun website for these methods, and actually tried them.....it does sort of work, except the interface looks kinda distorted after the update (ie. when i move the mouse cursor around the updated area, some components of the panel appears and disappears. So, without dragging it any further, I will once again explain in detail what I want this program to do, and then provide you with the code (I actually want to validate this code and see whether I am doing things in logical sense.
    Basically, the JFrame is divided into the following:
    A menu consisting of different integers (the selection of the menu determines
    how the interface is being changed) --- Located on very top of the interface
    A Jpanel, which contains three different sub-JPanels (used Border-Layout to divide
    this)
    North panel - contains two checboxes (but this does not has to do with my
    topic now)
    Centre panel - contains set of labelled radio buttons (THIS CHANGES
    UPON THE SELECTION OF THE MENU; THE LABEL BESIDE EACH BUTTONS CHANGE
    EVERYTIME THE MENU IS SELECTED)
    South panel - contains two JButtons (but again, not a concern at all)
    So this is the code, that I wrote in order to update the Centre part of the Main JPanel (ie. remove the sub-JPanel which already exists on the centre and add the newly created JPanel to Centre
    p_jvecframe.getContentPane().remove(2);
    p_jvecframe.getContentPane().validate();
    p_jvecframe.getContentPane().add(jpanelVECTORS, "Center");
    p_jvecframe.getContentPane().validate();
    p_jvecframe.repaint();Bit confused with one of thing:
    from Component.remove(int index), how does this index work? Is this like an array, where the top (or first in case of array) object on the Component is always integer 0?
    Your ideas and suggestions would be much appreciated. Thank you in advance.
    Regards,
    Young

    Swing related questions should be posted in the Swing forum.
    Generally when you add or remove components from a panel you should use revalidate() on the parent container.
    However, in your case maybe a better option is to use the CardLayout, which is designed specifically for this this purpose. Read the Swing totorial on "How to Use a Card Layout":
    http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.htmlWhen adding components to a BorderLayout, you don't need to remove the component first since only one component can exist at a given position at any time. So in the case of a BorderLayout, I don't know if "index 2" means anything in particular.
    It does make sense for a FlowLayout. Since every component added is just added to the end of the layout. Therefore you can reference the components in the order in which they are painted on the screen.

  • Automatic update download GUI bug - Windows 7

    Since I upgraded to a new laptop with Windows 7 (Pro, 64-bit) I've noticed a problem with the GUI on an occasional Adobe application update prompt.  A window with an Adobe logo pops up on my desktop, apparently trying to alert me about an available update.  But it looks like the attached image.  All that appears is a thumbnail of the upper-left corner of the window.  There are no scroll-bars by which to view what's in the remainder of the window, and not enough of the window shows to even be able to read WHAT Adobe application the update is for!  You can't re-size the window, either.  I have a large number of Adobe applications installed on my system (Acrobat Pro, Photoshop, Premiere, Flash, etc.), so it's impossible for me to say exactly which one is pulling this particular auto-update prompt.  But it looks like a bug in the code for the GUI.  The only thing slightly unusual about my system I can think of is that my laptop (a Dell E6510) has the 1920x1080 display option, which is a little higher resolution than typical.  But I haven't seen this problem with any other apps or update pop-ups on this system.
    This problem doesn't precisely fit any forum or user-feedback categories that I can find on the Adobe website, but I am posting here in a downloads-related forum on the chance that somebody internal to Adobe might come across this post and direct it to whomever should know.

    i sue windows 7 and my orignal macintosh formated and get online same window

  • Updating multiple GUI classes

    Hi,
    I'm wondering how it would be possible to have a class (class1) used for information, then two new classes (class2, class3) both used to display the same information from class1 in two seperate ways.
    So far I've put a variable in class2 and again in class3 that can be initialised to class1 at construction, so then all I do is just use class1's get() methods to get the information to display in class2 and class3.
    The problem is, I'm not sure how to make class2 and class3 update themselves every time the information in class1 changes.

    The GUI classes should register with the data class as change listeners. You'd typically create your own subclass of EventListener and EventObject. Add addXXXListner(), removeXXXListener and fireXXXListener methods to the data object. When the data changes the data objects first all the registered listeners, which can then query the new data in the normal way.

  • Updating CardLayout GUI

    After reading the grphics tutorial and about ten threads on the subject no answer was given, so I had no other way but to post a question...
    I have a CardLayout GUI which needs to add a JPanel with some calculations on it when asked to. It gets an ArrayList with values to display and the first time around it is no problem - it displays all values correctly. BUT - if I want to display new calculations nothing happens. I have checked to see that everything is handled properly and it is. I also tried to repaint, revalidate, validate, invalidate in several different places and on different containers.
    I need help...
    ArrayList mainList;
    JPanel loading;
    JPanel tablePanel;
    JLabel label1, label2, label4;
    // THE CONSTRUCTOR DISPLAYS A JPANEL TO SHOW WHEN THE CALCULATIONS
    // ARE BEING MADE - WORKS NICELY
    public ResultsCostEff(){
    canMoveForward = true;
    loading = new JPanel(new GridBagLayout());
    loading.setBackground(Color.WHITE);
    JLabel l = new JLabel("LOADING...");
    l.setFont(bold16);
    loading.add(l);
    panel.add(loading);
    this.addComponentListener(this);
    public void componentShown(ComponentEvent e) {
    GridBagLayout gbl = new GridBagLayout();
    tablePanel = new JPanel(gbl);
    GridBagConstraints gbc = new GridBagConstraints();
    tablePanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
    tablePanel.setBackground(Color.lightGray);
    // CHECKS TO SEE IF A FLAG IS SET TO GET A REFRESHED ARRAYLIST.
    if(getDataModel().getValue("valueschanged.costeff").equals("true")){
    getDataModel().setValue("valueschanged.costeff", "false");
    try {
    rioLogic.setVars(getDataModel());
    if(!(mainList == null)) mainList.clear();
    mainList = rioLogic.mainSearch();
    System.out.println(mainList);
    } catch (IOException e1) {
    e1.printStackTrace();
    gbc.fill = GridBagConstraints.BOTH;
    gbc.gridwidth = GridBagConstraints.RELATIVE;
    tablePanel.add(label1 = createLabel("Incremental costs:", gbl, gbc));
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    tablePanel.add(label2 = createLabel(mainList.get(4).toString(), gbl, gbc));
    gbc.gridwidth = GridBagConstraints.RELATIVE;
    tablePanel.add(createLabel("Life-years gained:", gbl, gbc));
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    tablePanel.add(label4 = createLabel("", gbl, gbc));
    System.out.println(mainList.get(6).toString());
    label4.setText(mainList.get(6).toString());
    System.out.println(label4.getText());
    gbc.gridwidth = GridBagConstraints.RELATIVE;
    tablePanel.add(createLabel("Cost per life year gained", gbl, gbc));
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    tablePanel.add(createLabel(mainList.get(1).toString(), gbl, gbc));
    gbc.gridwidth = GridBagConstraints.RELATIVE;
    tablePanel.add(createLabel("Quality adjusted life years gained (QALY)", gbl, gbc));
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    tablePanel.add(createLabel(mainList.get(5).toString(), gbl, gbc));
    gbc.gridwidth = GridBagConstraints.RELATIVE;
    tablePanel.add(createLabel("Cost per QALY year gained", gbl, gbc));
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    tablePanel.add(createLabel(mainList.get(0).toString(), gbl, gbc));
    panel.add(tablePanel, BorderLayout.CENTER);
    // HAVE CHECKED TO SEE THAT THE ARRAYLIST IS UPDATED THE SECOND
    // TIME AROUND. ALSO CHECKED TO SEE THAT LABELS HAVE RECEIVED
    // THEIR NEW VALUES.
    // TRIED TO PLACE THESE CALLS IN SEVERAL DIFFERENT PLACES. DID
    // DIFFERENCE WHAT SO EVER.
    loading.setVisible(false);
    tablePanel.setVisible(true);
    tablePanel.invalidate();
    tablePanel.revalidate();
    repaint();
    }

    The getDataModel is accessible through:
    abstract class WizardPanel extends JPanel implements WizardValidator{
        Font font, bold16, plain14, bold14;
        protected boolean canMoveForward = false;
        protected boolean canMoveBackward = true;
        Border empty10 = BorderFactory.createEmptyBorder(10,10,10,10);
        public RioLogic rioLogic;
        public WizardPanel() {
            this.setLayout(new BorderLayout());
            setPreferredSize(new Dimension (530, 450));
            try {
                font = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream("fonts/Dinla.ttf"));
            } catch (FontFormatException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            plain14 = font.deriveFont(14f);
            bold14 = font.deriveFont(1, 14f);
            bold16 = font.deriveFont(1, 16f);
            try {
                rioLogic = new RioLogic();
            } catch (IOException e) {
                e.printStackTrace();
        public boolean canMoveForward(){
            return canMoveForward;
        public boolean canMoveBackward(){
            return canMoveBackward;
        public DataCollectionModel getDataModel(){
            return ((JWizard)getParent().getParent()).getModel();
        public SequenceManager getSequenceManager(){
            return ((JWizard)getParent().getParent()).getManager();
        public RioLogic getRioLogic(){
            return rioLogic;
        public void setValuesChanged(){
            getDataModel().setValue("valueschanged.age", "true");
            getDataModel().setValue("valueschanged.costs", "true");
            getDataModel().setValue("valueschanged.risk", "true");
            getDataModel().setValue("valueschanged.costeff", "true");
    }

  • Update freezes GUI

    Hi, I'm using the newest thin driver to connect to an oracle 9 database.
    Though the executeBatchUpdate method is running in a separate thread, no GUI events are processed during the execution.
    This is very annoying because the update process takes a few seconds - the GUI is completely frozen.
    If I use the JDBC-ODBC Bridge instead, everything runs smoothly!
    Is this a known bug?
    I would be grateful for any suggestions,
    Hinnerk

    I found what I was thinking of:
    Mac OS X 10.4.3 update:
    * Disables Quartz 2D Extreme—Quartz 2D Extreme is not a supported feature in Tiger, and re-enabling it may lead to video redraw issues or kernel panics.
    http://www.apple.com/support/downloads/macosxupdate1043.html
    Quartz 2D Extreme
    What Quartz Extreme did for the Quartz Compositor, Quartz 2D Extreme does for the Quartz 2D drawing API. Here's what the Quartz implementation looks like in Tiger.
    http://arstechnica.com/reviews/os/macosx-10.4.ars/14
    Message was edited by: The hatter

  • JTextArea.setText("String ") not updating the GUI.

    Hi,
    When i tried to update the JTextArea with a new String it is not replacing the string in the TextArea.
    If I try to print the content by retrieving the data in the TextArea using JTextArea.getText() it is showing the latest string set to the JTextArea.
    What might be the problem?
    DP

    Here is the code. I am calling the displayMessage() from onMessage() method.
    private void displayMessage(String str){
         textArea.setText(str);
         textArea.revalidate();
         System.out.println("Message Received from QUE: "+ textArea.getText());
    public void onMessage(Message msg) {
    try {
    if (msg instanceof TextMessage) {
         msgText = ((TextMessage)msg).getText();
    } else {
         msgText = msg.toString();
         msgText = msgText.trim();
    System.out.println(msgText );
    displayMessage(msgText);

  • Updating a GUI component

    Hello,
    My application has an output window with a JTextArea as one of the components. This window is instantiated when the application starts up. What would be the best way to update the JTextArea component with the messages (status reports) generated by the other classes. What technique should I employ in this regard?
    Thank You.

    Here is my idea:
    I do not think it is a good design to pass textArea to any components
    that need to report the status message.
    It is may-be better using proxy design.
    Let's say, created a StatusManager class.
    The status manager can have different constructors,
    for example constructor with textarea as parameter,
    or other constuctor with outputsteam as parameter ...etc.
    And you pass the StatusManager to any components that needed to report the status message.
    In this way, all components just use StatusManager's method to report the message,
    and StatusManager can control the synchronized of message, the "output" of message
    ( to textarea or file ), and may-be also reformat the message.
    In fact, have one layer between the source ( components report message ) and the real destination
    ( your textarea), it will become more flexible ( esay to change in the future) and esay to maintenance.
    If you like this idea, you can even make more generic, like create your own listener interface,
    any component (the destination part) can implement the listener and register to the StatusManager
    in the way, you can even report to multi-destination.
    Just my thought.

  • GNOME 3.10 update caused GUI artifacts

    Ever since the Gnome 3.10 update I've been getting weird artifacts in the windows bar when accessing certain settings/apps. Such as going into network manager settings and opening up Evolution mail client. There are these random black bars and artifacts.
    Evolution Mail Client Screenshot:
    Network Manager Screenshot:
    Last edited by mrhpeng (2013-10-16 05:26:59)

    trunneml wrote:
    Hi,
    I reinstalled gnome3, gtk3, radeon and libtxc_dxtn and the worst issues are gone. May be you can try:
    pacman -S gnome
    pacman -S gtk3
    pacman -S libtxc_dxtn
    Thank you! Your solution improved the problem a bit. There is still minor artifacts, however it is much more bearable now! Lets hope Gnome fixes this bug soon.

Maybe you are looking for