Updating jProgressBar

Hi, I have an Iterator in my method that I want to update the jProgressBar after each iteration. The follow snippet of code doesn't update th bar. How to I update the Bar?
    private void xpathExample(java.awt.event.ActionEvent evt) {
        try {
            System.setProperty("javax.xml.xpath.XPathFactory:" + NamespaceConstant.OBJECT_MODEL_SAXON, "net.sf.saxon.xpath.XPathFactoryImpl");
            XPathFactory xpf = XPathFactory.newInstance(NamespaceConstant.OBJECT_MODEL_SAXON);
            XPath xpe = xpf.newXPath();
            returnParser("Loaded XPath Provider: " + xpe.getClass().getName());
            returnParser("Using Saxon 9.0 XPATH");
            InputSource is = new InputSource(new File(this.jTextField1.getText()).toURL().toString());
            SAXSource ss = new SAXSource(is);
            NodeInfo doc = ((XPathEvaluator) xpe).setSource(ss);
            XPathExpression findLine = xpe.compile("//graphic[@boardno]");
            XPathExpression findLocation = xpe.compile("@boardno");
            XPathExpression findSpeaker = xpe.compile("string-join(ancestor-or-self::*/name(), '/')");
            XPathExpression countLines = xpe.compile("count(//graphic[@boardno])");
            String nodeCount = "";
            int i = 0;
            // Set progress
            this.jProgressBar1.setMaximum(1500);
            this.jProgressBar1.setMinimum(0);
            this.jProgressBar1.setValue(0);
            Border border = BorderFactory.createTitledBorder("Reading...");
            int finalCount = 0;
            // Compile the XPath expressions used by the application
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            try {
                List matchedLines = (List) findLine.evaluate(doc, XPathConstants.NODESET);
                // Loop until the user enters "." to end the application
                boolean found = false;
                if (matchedLines != null) {
                    for (Iterator iter = matchedLines.iterator(); iter.hasNext();) {
                        try {
                            found = true;
                            // Get the next matching line
                            NodeInfo line = (NodeInfo) iter.next();
                            // Find where it appears in the play
                            returnParser("File Name: " + findLocation.evaluate(line));
                            // Output the name of the speaker and the content of the line
                            returnParser("Absolute Path: " + findSpeaker.evaluate(line));
                            nodeCount = countLines.evaluate(line);
                            returnParser("Node Count TOTAL:" + nodeCount);
                            i = i + 1;
                            finalCount = Integer.parseInt(nodeCount);
                            // update jProgressBar here!
                            updateBar(i);
                        } catch (XPathExpressionException ex) {
                            Logger.getLogger(startForm.class.getName()).log(Level.SEVERE, null, ex);
                // If no lines were found, say so
                if (!found) {
                    returnParser("XPATH NOT FOUND'");
            } catch (XPathExpressionException ex) {
                Logger.getLogger(startForm.class.getName()).log(Level.SEVERE, null, ex);
            returnParser("Finished.");
        } catch (net.sf.saxon.trans.XPathException ex) {
            Logger.getLogger(startForm.class.getName()).log(Level.SEVERE, null, ex);
        } catch (MalformedURLException ex) {
            Logger.getLogger(startForm.class.getName()).log(Level.SEVERE, null, ex);
        } catch (XPathFactoryConfigurationException ex) {
            Logger.getLogger(startForm.class.getName()).log(Level.SEVERE, null, ex);
        } catch (XPathExpressionException ex) {
            Logger.getLogger(startForm.class.getName()).log(Level.SEVERE, null, ex);
    }Updater Here
public void updateBar(int val) {
        this.jProgressBar1.setValue(val / 1500);
    }Thanks for the help!
Phil

Disclaimer: I haven't read through all of your code.
The short way:
1. run the iteration in a separate Thread
2. wrap the progressBar.setProgress in a SwingUtilities.invokeLater
Probably a better way:
Use a SwingWorker. Perform the iteration in doInBackground. Call publish from doInBackground and update the progress bar from process.
There are simple examples in the SwingWorker API that'll get you going.
luck, db
edit Hello Pete, nice to see we think the same way!
Edited by: Darryl.Burke

Similar Messages

  • Help with updating jprogressbar

    Hi,
    I'm currently trying to create a JProgressBar which tracks the progress of a function. Basically, I know that I need to use threads to update the progress bar, but I have never used threads in Java. Can someone just give me a basic example of how I can make it work, so the progress bar updates?
    Thanks, currently I have a start button, that calls a method called startChecking to start the calculation.

    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#ProgressBarDemo

  • Update JProgressBar

    Hi. I want to use a progress bar while sending an object file to a servlet. The bold part shows were the file is uploaded. This event takes 5 seconds. During that time I want to use a progressbar or bether a progressmonitor. Here a snippet of my code:
    public static boolean staticCallUpload(String fileName, JProgressBar pb)
    SwingWorker worker = new SwingWorker()
    public Object construct()
    String s = "";
    File file;
    FileInputStream fileInputStream;
    DataOutputStream toServer;
    ProgressMonitorInputStream pmis;
    byte[] buffer;
    int bytesRead = 0, _port;
    String clientProtocol, clientHost, clientPort;
    progressBar.setValue(0);
    try
    file = new File(uploadFileName);
    fileInputStream = new FileInputStream(file);
    buffer = new byte[fileInputStream.available()];
    if(Spec.ISOFFLINE && Spec.DEBUG)
    clientProtocol = protocol;
    clientHost = host;
    clientPort = EVUtil.IntToString(port);
    else
    clientProtocol = System.getProperty("ClientProtocol");
    clientHost = System.getProperty("ClientHost");
    clientPort = System.getProperty("ClientPort");
    _port = EVUtil.StringToInt(clientPort);
    URL dataURL = new URL(clientProtocol+"://" + clientHost
    +((_port <= 0) ? "" : ":"+_port)
    + ServletPath.SERVLETUPLOAD);
    HttpURLConnection connection = (HttpURLConnection)dataURL.openConnection();
    connection.setUseCaches(false);
    connection.setDoOutput(true);
    toServer = new DataOutputStream(connection.getOutputStream());
    //Write the streams of bytes to the output stream ...
    int size = toServer.size();
    while ((bytesRead = fileInputStream.read(buffer)) > -1)
    toServer.write(buffer, 0, bytesRead);
    toServer.flush();
    toServer.close();
    fileInputStream.close();
    ObjectInputStream fromServer = new ObjectInputStream(new ZIPInputStream(connection.getInputStream()));
    s = (String)fromServer.readObject();
    fromServer.close();
    try
    file.delete();
    catch( Exception e ) {e.printStackTrace();}
    catch( Exception evt )
    evt.printStackTrace();
    return false;
    return "finished";
    worker.start();
    return true;
    }

    Hi. I want to use a progress bar while sending an object file to a servlet. The bold part shows were the file is uploaded. This event takes 5 seconds. During that time I want to use a progressbar or bether a progressmonitor. Here a snippet of my code:
    public static boolean staticCallUpload(String fileName, JProgressBar pb)
    SwingWorker worker = new SwingWorker()
    public Object construct()
    String s = "";
    File file;
    FileInputStream fileInputStream;
    DataOutputStream toServer;
    ProgressMonitorInputStream pmis;
    byte[] buffer;
    int bytesRead = 0, _port;
    String clientProtocol, clientHost, clientPort;
    progressBar.setValue(0);
    try
    file = new File(uploadFileName);
    fileInputStream = new FileInputStream(file);
    buffer = new byte[fileInputStream.available()];
    if(Spec.ISOFFLINE && Spec.DEBUG)
    clientProtocol = protocol;
    clientHost = host;
    clientPort = EVUtil.IntToString(port);
    else
    clientProtocol = System.getProperty("ClientProtocol");
    clientHost = System.getProperty("ClientHost");
    clientPort = System.getProperty("ClientPort");
    _port = EVUtil.StringToInt(clientPort);
    URL dataURL = new URL(clientProtocol+"://" + clientHost
    ((_port <= 0) ? "" : ":"_port)
    + ServletPath.SERVLETUPLOAD);
    HttpURLConnection connection = (HttpURLConnection)dataURL.openConnection();
    connection.setUseCaches(false);
    connection.setDoOutput(true);
    toServer = new DataOutputStream(connection.getOutputStream());
    //Write the streams of bytes to the output stream ...
    int size = toServer.size();
    while ((bytesRead = fileInputStream.read(buffer)) > -1)
    toServer.write(buffer, 0, bytesRead);
    toServer.flush();
    toServer.close();
    fileInputStream.close();
    ObjectInputStream fromServer = new ObjectInputStream(new ZIPInputStream(connection.getInputStream()));
    s = (String)fromServer.readObject();
    fromServer.close();
    try
    file.delete();
    catch( Exception e ) {e.printStackTrace();}
    catch( Exception evt )
    evt.printStackTrace();
    return false;
    return "finished";
    worker.start();
    return true;
    }

  • JProgressBar is not updating even in new Thread !

    Hello every buddy....
    I'm new to SDN and I hope I'll enjoy being an active member.
    I've a problem with updating JProgressBar in actionPerformed method. I know that GUI can not be updating in the event dispatching thread, so, I created a new class to show the JProgress bar in a separate thread as follows:
    {color:#333399}import javax.swing.JProgressBar;
    import javax.swing.Frame;
    public class ProgressBar
    public ProgressBar()
    new Thread(new Runnable()
    public void run()
    showProgressBar();
    }).start();
    }// End of constructor
    private void showProgressBar()
    JProgressBar pb = new JProgressBar(0, 100);
    pb.setPainted(true);
    JFrame f = new Frame();
    f.setSize(250, 100);
    f.getContentPane().add(pb);
    f.setVisible(true);
    while( Crypt.done == false)
    pb.setValue( Crypt.percentageCompleted );
    f.dispose();
    f = null;
    }// End of showProgressBar method
    } // End of ProgressBar class
    {color}{color:#000000}I create an objmect of the above class inside another class called Crypt. when a button is clicked actionPerformed is invoked I do:
    ProgressBar progress = new ProgressBar();
    the frame f shows, but the JProgressBar never shows!
    Can anyone help me?
    with best wishes{color}

    scphan wrote:
    your declaration worked when i plugged it in into my program
    but the way you've programmed the JProgressBar to update is very inefficient, you should just get a ref to your JProgressBar and call setValue() from inside the loop of whatever you're doing
    Edited by: scphan on Mar 24, 2009 10:04 AMThat's bad advice. The setValue method must be invoked on the EDT. I suggest using a SwingWorker and its progress bound property:
    [http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html]

  • JProgressBar,how to update in file transfer?

    Hi ..
    I have the following copy code that uses java nio package, how to update jProgressBar to indicate movement in file transfer?
    I needn't use progress monitor...
        public static void copyFile(File sourceFile, File destFile) throws IOException {
    if(!destFile.exists()) {
      destFile.createNewFile();
    FileChannel source = null;
    FileChannel destination = null;
    try {
      source = new FileInputStream(sourceFile).getChannel();
      destination = new FileOutputStream(destFile).getChannel();
      destination.transferFrom(source, 0, source.size());
    //JOptionPane.showMessageDialog(null, destination.position());
    finally {
      if(source != null) {
       source.close();
      if(destination != null) {
       destination.close();
        }Thanks..
    Feras

    Inorder to update your progress bar, you have to have it in a different thread and update it--you also have to do the copy in segmented fashion... if you have one stream running continuously, then you cannot update anything.

  • JProgressBar while file copy

    Hello,
    I give backup option in my application.
    so while taking backup (just file copy), i need to show the status of the file copying in JProgressbar
    Can any one give solution with sample.

    import java.awt.*;
    import javax.swing.*;
    public class X {
        public static void main(String[] args) {
            JFrame f = new JFrame("X");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JProgressBar bar = new JProgressBar(0,100);
            bar.setStringPainted(true);
            final Updater updater = new Updater(bar);
            f.getContentPane().add(bar, BorderLayout.NORTH);
            f.pack();
            f.show();
            Runnable example = new Runnable() {
                public void run() {
                    for(int i=0; i<=100; i+=5) {
                        try {
                            Thread.sleep(1000);
                        } catch (InterruptedException e) {
                        updater.update(i);
            new Thread(example).start();
    class Updater  {
        private final JProgressBar jpb;
        private boolean queued;
        private int val;
        private Runnable runnable = new Runnable() {
            public void run() {//called from EDT:
                int _val;
                synchronized(Updater.this) {
                    queued = false;
                    _val = val;
                jpb.setValue(_val);
        public Updater(JProgressBar jpb) {
            this.jpb = jpb;
        public void update(int _val) {
            boolean go = false;
            synchronized(this) {
                val = _val;
                if (!queued) {
                    queued = true;
                    go = true;
            if (go)
                SwingUtilities.invokeLater(runnable);
    }1. I'm assuming you're backing up in a non-EDT thread, to avoid locking up your GUI.
    2. If 1 is true, you have to be careful to call Swing using methods like SwingUtilities.invokeLater. See:
    http://java.sun.com/docs/books/tutorial/uiswing/overview/threads.html
    3. My Updater class is the heart of this example. It is smart enough to update the progress bar's future value while this value is queued for the EDT.

  • Threads + Swing = Confusion

    Hi all,
    I am having a problem with threads and Swing apps. I have read the tutorial 3 times and get more confused each time i try to understand how to update the gui with the other thread.
    At this point I'm just trying to do something simple (eventually i want the gui to report all the progress of the action): get a progress bar to be updated through a Thread Class. I have the gui built with a button and a progress bar. Here is the codei have for the simpleThread class
    import java.awt.*;
    import javax.swing.*;
    public class simpleThread extends Thread{
        public simpleThread(String str) {
            super(str);
        public void run() {
            for (int i = 0; i<1000000; i++) {
                final int x = i;
                Runnable getTextFieldText = new Runnable() {
                    public void run() {
                       jProgressBar1.setValue(x);
        SwingUtilities.invokeAndWait(getTextFieldText);
    }The problem i have is that the thread doesn't recognize the gui form. Any help on getting the progress bar to update with the thread would be great! Thanks! :)

    There's been too much bad code submitted to this topic to comment on it individually, but:
    1. Don't call a thread or runnable's run() method directly, if you expect it to be executed in a different thread! Call thread's start method instead.
    2. If you want code executed in the Event Dispatch Thread (EDT), pass a runnable to InvokeLater (usually preferrable to InvokeAndWait). That runnable's run method will be executed in the EDT -- there's no need to write complicated nested run methods!
    In the case of JProgressBar, I was concerned about flooding the EDT with many "invokeLater" runnables, so I penned this wee class:
    import javax.swing.*;
    public class Updater  {
         private final JProgressBar jpb;
         private boolean queued;
         private int val;
         private Runnable runnable = new Runnable() {
              public void run() {//called from EDT:
                   int _val;
                   synchronized(Updater.this) {
                        queued = false;
                        _val = val;
                   jpb.setValue(_val);
         public Updater(JProgressBar jpb) {
              this.jpb = jpb;
         public void update(int _val) {
              boolean go = false;
              synchronized(this) {
                   val = _val;
                   if (!queued) {
                        queued = true;
                        go = true;
              if (go)
                   SwingUtilities.invokeLater(runnable);
    }To use it, you would typically declare it as a field:
    private Updater updater = new Updater(yerBar);Then repeatedly call (from any thread)
    updater.update(yerValue);

  • Trouble in implementing a progress monitor?

    I need a lot of calculation when I click start button, so, I made a thread using SwingWorker class, this thread is responsible for the calculation. I need a progress monitor to display the progress of the calculation, so, do I need another thread to do it? How can I do it? Any suggestion is great appreciated.
    The following is the schetch of my class.
    // this class do the calculation
    // these stuff is within my button listener
    MyClass my = new MyClass(...);
    my.go();
    // stuff in go() method of MyClass is :
    final SwingWorker worker = new SwingWorker() {
    void construct(){
    // Do calculation
    void finished(){}
    How to add another thread to do progress monitor stuff?

    I assume your concern is about updating JProgressBar's value property from your SwingWorker's thread. Since you're using SwingWorker I assume you know the whole "Swing is not Thread-Safe" drill. If only Sun would specify a few more methods to be thread-safe, like JProgressBar's setValue! After all, isn't the raison d'etre of a progress bar to show how another thread is doing? Oh well, why not use my code, below. You don't need another thread, you only need to access Swing from the EDT, hence my calls to InvokeLater. And in case the progress updates come fast and furious, my code coalesces those events. Enjoy -- Nax.
    class Updater implements Runnable {
         public Updater(JProgressBar jpb) {
              this.jpb = jpb;
         public void run() {
              int v;
              synchronized(this) {
                   queued = false;
                   v = val;
              jpb.setValue(v);
         public void update(int v) {
              boolean go = false;
              synchronized(this) {
                   val = v;
                   if (!queued) {
                        queued = true;
                        go = true;
              if (go)
                   SwingUtilities.invokeLater(this);
         private boolean queued;
         private int val;
         private final JProgressBar jpb;

  • JProgressBar Shows Up Too Late--How Do I Update the Display Immediately?

    My application has a split pane, the bottom page of which is a panel containing an image that takes a long time to load. For that reason, I want the bottom pane to be a panel with a progress bar until the image is ready.
    Here's a simple version of my code:
    JPanel progressBarPanel = new JPanel();
    JProgressBar progressBar = new JProgressBar(0, 1);
    progressBar.setIndeterminate(true);
    progressBarPanel.add(progressBar);
    splitPane.setBottomComponent(progressBarPanel);  // line A
    splitPane.invalidate();
    JPanel imagePanel = createImagePanelSlowly();  // line B
    splitPane.setBottomComponent(imagePanel);
    splitPane.invalidate();However, this doesn't work; the display isn't updated until the image is ready. What do I need to put in between lines A and B so that the progress bar shows up before line B starts executing? I've tried validate(), repaint(), using threads and setting the size of the frame to zero and back again, but none of those seem to work. If I pop up a dialog after I add the progress bar to the split pane, the progress bar shows up as soon as the dialog shows up.
    This code is inside a ListSelectionListener on a table elsewhere on the GUI, in case that's relevant.
    I think I don't understand some basic principle about how to get the GUI to be updated immediately after I make some change.

    As suggested, I have prepared a compilable demonstration. I figured out that the
    problem I was having before was that I was trying to join the background and
    event-processing threads (I had been using threads, but I didn't show that code in the
    version I posted since it didn't seem to matter). After I eliminated the join, the progress
    bar is displayed, but the user can do other things while the image is loading. I want to
    prevent the user from doing that. I switched the cursor to a wait cursor, but that doesn't
    seem to prevent it.
    In particular, while it is loading, the user should be able to:
    * resize the window
    * minimize the window and bring it back up
    * ideally, adjust the split pane, but that isn't critical
    but NOT:
    * select a different row in the table
    * sort the table
    * use the menus
    Any attempt by the user to perform the disallowed actions should have no effect either
    while the image is loading or after it has finished.
    (That is, the disallowed events should not simply be queued for later.)
    I wonder if there is a simple way to accomplish that.
    Here is a demo (3 classes):
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Cursor;
    import java.awt.Font;
    import java.awt.GraphicsEnvironment;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.util.Enumeration;
    import java.util.Vector;
    import javax.swing.Box;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JProgressBar;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.JTable;
    import javax.swing.ListSelectionModel;
    import javax.swing.UIManager;
    import javax.swing.border.Border;
    import javax.swing.border.EtchedBorder;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableColumn;
    * <p>Copyright (C) 2006
    * <p>All rights reserved.
    public class DisableGUIDemo extends JFrame {
         static final Rectangle SCREEN_SIZE = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
         static final Color HYACINTH = new Color(160, 96, 192);
         static final Color LAVENDER = new Color(224, 208, 232);
         Vector<Vector<String>> demoTableData = new Vector<Vector<String>>();
         Vector<String> demoColumnNames = new Vector<String>();
         protected JTable dataTable;
         protected JScrollPane tablePane;
         protected JSplitPane mainPane;
         protected JPanel imageArea;
         private DefaultTableModel dataModel;
          * This creates a new <code>DisableGUIDemo</code> instance, builds the UI
          * components and displays them.
         private DisableGUIDemo(){
              super();
              setTitle("Demo");
              // Ugly:  Initialize the table with demo data.
              Vector<String> demoTableFirstRow = new Vector<String>();
              demoTableFirstRow.add("18");
              demoTableFirstRow.add("13");
              demoTableFirstRow.add("11");
              demoTableFirstRow.add("19");
              demoTableFirstRow.add("19");
              demoTableData.add(demoTableFirstRow);
              Vector<String> demoTableSecondRow = new Vector<String>();
              demoTableSecondRow.add("5");
              demoTableSecondRow.add("3");
              demoTableSecondRow.add("4");
              demoTableSecondRow.add("1");
              demoTableSecondRow.add("3");
              demoTableData.add(demoTableSecondRow);
              Vector<String> demoTableThirdRow = new Vector<String>();
              demoTableThirdRow.add("11");
              demoTableThirdRow.add("12");
              demoTableThirdRow.add("10");
              demoTableThirdRow.add("18");
              demoTableThirdRow.add("18");
              demoTableData.add(demoTableThirdRow);
              demoColumnNames.add("Column 0");
              demoColumnNames.add("Column 1");
              demoColumnNames.add("Column 2");
              demoColumnNames.add("Column 3");
              demoColumnNames.add("Column 4");
              dataModel = new DefaultTableModel(demoTableData, demoColumnNames);
              initialize(); 
          * The <code>initialize</code> method builds and displays up the GUI.
         private void initialize() {
              addWindowListener(new WindowAdapter()  {
                        public void windowClosing(WindowEvent e)  {
                             System.exit(0);
              // Build the GUI panels.
              setJMenuBar(menuBar());
              createSplitPane(true);
              setLocation(SCREEN_SIZE.x, SCREEN_SIZE.y);
              setSize(SCREEN_SIZE.width, SCREEN_SIZE.height - 20);
              setVisible(true); 
          * This creates and returns the menu bar.  The actions to take in response to menu-option selections are
          * specified here.
          * @return the menu bar
         private JMenuBar menuBar(){
              JMenuBar menuBar = new JMenuBar();
              JMenu fileMenu = new JMenu("File");
              fileMenu.setFont(fileMenu.getFont().deriveFont(10.0f));
              JMenuItem reset = new JMenuItem("Reset");
              reset.setFont(reset.getFont().deriveFont(10.0f));
              reset.addActionListener(new ActionListener(){
                        // When the user resets the display, the configuration panel is recreated.
                        public void actionPerformed(ActionEvent e){
                             dataModel = new DefaultTableModel(demoTableData, demoColumnNames);
                             createSplitPane(true);
                             int oldWidth = getWidth();
                             int oldHeight = getHeight();
                             setSize(0, 0);
                             setSize(oldWidth, oldHeight);
                             repaint();
                             JOptionPane.showMessageDialog(DisableGUIDemo.this,
                                                                                                        "The display should be reset.",
                                                                                                        "Reset",
                                                                                                        JOptionPane.PLAIN_MESSAGE);
              fileMenu.add(reset);
              fileMenu.addSeparator();
              JMenuItem saveTable = new JMenuItem("Save Table");
              saveTable.setFont(saveTable.getFont().deriveFont(10.0f));
              saveTable.setEnabled(false);
              fileMenu.add(saveTable);
              menuBar.add(fileMenu);
              menuBar.add(Box.createHorizontalGlue());
              JMenu helpMenu = new JMenu("Help");
              helpMenu.setFont(helpMenu.getFont().deriveFont(10.0f));
              JMenuItem help = new JMenuItem("Documentation");
              help.setFont(help.getFont().deriveFont(10.0f));
              help.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent e){
                             JOptionPane.showMessageDialog(DisableGUIDemo.this, "There is no documentation available for the demo.");
              helpMenu.add(help);
              menuBar.add(helpMenu);
              return menuBar;
          * The <code>createSplitPane</code> method creates the table and image area and displays them in a split pane.
          * @param createNewTable whether to create a new table (should be false if the table has already been created)
         private void createSplitPane(boolean createNewTable){
              if (createNewTable){
                   dataTable = dataTable();
                   tablePane = new JScrollPane(dataTable);
                   Border etchedBorder = new EtchedBorder(EtchedBorder.RAISED, LAVENDER, HYACINTH);
                   tablePane.setBorder(etchedBorder);
              int tablePaneWidth = tablePane.getPreferredSize().width;
              int selectedRow = dataTable.getSelectedRow();
              imageArea
                   = (selectedRow == -1)
                   ? new JPanel()
                   : imageArea((String) dataTable.getValueAt(selectedRow, 0),
                                                 (String) dataTable.getValueAt(selectedRow, 2));
              imageArea.setMinimumSize(imageArea.getPreferredSize());
              mainPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, tablePane, imageArea);
              getContentPane().removeAll();
              getContentPane().add(mainPane);
          * The <code>dataTable</code> method returns the data table.
          * @return the data table
         private JTable dataTable(){
              JTable table = new JTable(dataModel);
              table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              ListSelectionModel rowSM = table.getSelectionModel();
              rowSM.addListSelectionListener(new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent e) {
                             if (e.getValueIsAdjusting()){
                                  return;  // Ignore extra events.
                             ListSelectionModel lsm =
                (ListSelectionModel) e.getSource();
                             if (! lsm.isSelectionEmpty()){
                                  final int selectedRow = dataTable.getSelectedRow();
                                  setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                                  JPanel progressBarPanel = new JPanel();  // This should have a border layout.
                                  JProgressBar progressBar = new JProgressBar(0, 1);
                                  progressBar.setIndeterminate(true);
                                  progressBarPanel.add(progressBar);
                                  mainPane.setBottomComponent(progressBarPanel);
                                  mainPane.invalidate();
                                  mainPane.validate();
                                  Thread backgroundThread = new Thread(){
                                            public void run(){
                                                 JPanel imageDisplay = imageArea((String) dataTable.getValueAt(selectedRow, 0),
                                                                                                                                 (String) dataTable.getValueAt(selectedRow, 2));
                                                 mainPane.setBottomComponent(imageDisplay);
                                                 mainPane.invalidate();
                                                 setCursor(null);
                                  backgroundThread.start();
                                  // The following code, before being commented out, caused the GUI to be unresponsive while the image was
                                  // being loaded.  However, without it, the user can do other things while the image is loading, which is
                                  // not desired.
    //                               try{
    //                                    backgroundThread.join();
    //                               catch (InterruptedException ie){
    //                                    // N/A
              if (dataModel != null){
                   table.sizeColumnsToFit(-1);
                   table.getTableHeader().setReorderingAllowed(false);
                   SpecialHeaderRenderer headerRenderer = new SpecialHeaderRenderer(this);
                   SpecialCellRenderer bodyCellRenderer = new SpecialCellRenderer();
                   int i = 0;
                   for (Enumeration<TableColumn> columns = table.getColumnModel().getColumns(); columns.hasMoreElements(); /** */){
                        int columnWidth = 0;
                        TableColumn nextColumn = columns.nextElement();
                        nextColumn.setHeaderRenderer(headerRenderer);
                        nextColumn.setCellRenderer(bodyCellRenderer);
                        nextColumn.sizeWidthToFit();
                        Component comp = headerRenderer.getTableCellRendererComponent(table, nextColumn.getHeaderValue(),
                                                                                                                                                                                   false, false, 0, 0);
                        columnWidth = comp.getPreferredSize().width;
                        for (int j = 0; j < dataModel.getRowCount(); j++){
                             comp = table.getCellRenderer(j, i).getTableCellRendererComponent(table, dataModel.getValueAt(j, i),
                                                                                                                                                                                              false, false, j, i);
                             columnWidth = Math.max(comp.getPreferredSize().width, columnWidth);
                        nextColumn.setPreferredWidth(columnWidth);
                        nextColumn.setMinWidth(columnWidth);
                        i++;
              return table;
          * The <code>imageArea</code> method returns a panel in which an image is shown in the real application.
          * In the demo application, it is replaced by a text label; an artificial delay is used to simulate the
          * delay that would occur during image loading.  The image is loaded when the user selects a row in the table.
          * @param parameter1 a parameter to image creation
          * @param parameter2 a parameter to image creation
          * @return a panel in which a text label stands in for an image
         private JPanel imageArea(String parameter1, String parameter2){
              try{
                   Thread.sleep(3000);
              catch (InterruptedException ie){
                   // N/A
              JPanel imagePanel = new JPanel();
              JLabel substituteLabel = new JLabel("Image for " + parameter1 + ", " + parameter2);
              imagePanel.add(substituteLabel);
              return imagePanel;
          * @param args
         public static void main (String[] args) {
              UIManager.put("Table.font", new Font("DialogInput", Font.PLAIN, 10));
              UIManager.put("Label.font", new Font("Dialog", Font.BOLD, 10));
              UIManager.put("TextField.font", new Font("DialogInput", Font.PLAIN, 10));
              UIManager.put("ComboBox.font", new Font("Dialog", Font.BOLD, 10));
              UIManager.put("Button.font", new Font("Dialog", Font.BOLD, 10));
              UIManager.put("List.font", new Font("Dialog", Font.BOLD, 10));
              try {           
                   new DisableGUIDemo();
              catch (Throwable e) {
                   e.printStackTrace();
                   System.exit(0);
         } // end of main ()
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Font;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.GridLayout;
    import java.awt.Insets;
    import java.awt.Rectangle;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.util.Comparator;
    import java.util.TreeSet;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.SwingConstants;
    import javax.swing.UIManager;
    import javax.swing.border.EmptyBorder;
    import javax.swing.table.TableCellRenderer;
    * <p>Copyright (C) 2006
    * <p>All rights reserved.
    public class SpecialHeaderRenderer extends JPanel implements TableCellRenderer {
         static final Color MAUVE = new Color(192, 160, 208);
         static final Insets ZERO_INSETS = new Insets(0, 0, 0, 0);
         static final EmptyBorder EMPTY_BORDER = new EmptyBorder(ZERO_INSETS);
         private GridBagConstraints constraints = new GridBagConstraints();
         final TreeSet<MouseEvent> processedEvents = new TreeSet<MouseEvent>(new Comparator<MouseEvent>(){
              public int compare(MouseEvent o1, MouseEvent o2){
                   return o1.hashCode() - o2.hashCode();
         final private JFrame owner;
      public SpecialHeaderRenderer(JFrame ownerWindow) {
        setOpaque(true);
        setForeground(Color.BLACK);
              setBackground(MAUVE);
        setBorder(UIManager.getBorder("TableHeader.cellBorder"));
              setLayout(new GridBagLayout());
              constraints.fill = GridBagConstraints.NONE;
              constraints.gridx = 0;
              setAlignmentY(Component.CENTER_ALIGNMENT);
              owner = ownerWindow;
      public Component getTableCellRendererComponent(final JTable table, Object value, boolean isSelected,
                                                                                                                             boolean hasFocus, int row, final int column){
              if (table != null){
                   removeAll();
                   String valueString = (value == null) ? "" : value.toString();
                   JLabel title = new JLabel(valueString);
                   title.setHorizontalAlignment(SwingConstants.CENTER);
                   title.setFont(title.getFont().deriveFont(12.0f));
                   constraints.gridy = 0;
                   constraints.insets = ZERO_INSETS;
                   add(title, constraints);
                   final JPanel buttonPanel = new JPanel();
                   buttonPanel.setLayout(new GridLayout(1, 2));
                   buttonPanel.setAlignmentX(Component.CENTER_ALIGNMENT);
                   buttonPanel.setBackground(MAUVE);
                   final JButton sortAscendingButton = new JButton("V");
                   sortAscendingButton.setMargin(ZERO_INSETS);
                   sortAscendingButton.setBorder(EMPTY_BORDER);
                   constraints.gridy = 1;
                   constraints.insets = new Insets(5, 0, 0, 0);
                   buttonPanel.add(sortAscendingButton);
                   final JButton sortDescendingButton = new JButton("^");
                   sortDescendingButton.setMargin(ZERO_INSETS);
                   sortDescendingButton.setBorder(EMPTY_BORDER);
                   buttonPanel.add(sortDescendingButton);
                   add(buttonPanel, constraints);
                   table.getTableHeader().addMouseListener(new MouseAdapter(){
                             public void mouseClicked(MouseEvent e) {
                                  Rectangle panelBounds = table.getTableHeader().getHeaderRect(column);
                                  Rectangle buttonPanelBounds = buttonPanel.getBounds();
                                  Rectangle buttonBounds = sortAscendingButton.getBounds();
                                  buttonBounds.translate(buttonPanelBounds.x, buttonPanelBounds.y);
                                  buttonBounds.translate(panelBounds.x, panelBounds.y);
                                  if (buttonBounds.contains(e.getX(), e.getY()) && processedEvents.add(e)){
                                       // The click was on this button and has not yet been processed.
                                       JOptionPane.showMessageDialog(owner,
                                                                                                                  "The table would be sorted in ascending order of column " + column + ".",
                                                                                                                  "Sorted Ascending",
                                                                                                                  JOptionPane.PLAIN_MESSAGE);
                                       table.invalidate();
                                       table.revalidate();
                                       table.repaint();
                                  buttonBounds = sortDescendingButton.getBounds();
                                  buttonBounds.translate(buttonPanelBounds.x, buttonPanelBounds.y);
                                  buttonBounds.translate(panelBounds.x, panelBounds.y);
                                  if (buttonBounds.contains(e.getX(), e.getY()) && processedEvents.add(e)){
                                       // The click was on this button and has not yet been processed.
                                       JOptionPane.showMessageDialog(owner,
                                                                                                                  "The table would be sorted in descending order of column " + column + ".",
                                                                                                                  "Sorted Descending",
                                                                                                                  JOptionPane.PLAIN_MESSAGE);
                                       table.invalidate();
                                       table.revalidate();
                                       table.repaint();
              return this;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Font;
    import java.awt.GridLayout;
    import java.util.HashMap;
    import javax.swing.BorderFactory;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.SwingConstants;
    import javax.swing.border.EmptyBorder;
    import javax.swing.border.LineBorder;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.TableCellRenderer;
    * <code>SpecialCellRenderer</code> is the custom renderer for all
    * rows except the header row.
    * <p>Copyright (C) 2006
    * <p>All rights reserved.
    public class SpecialCellRenderer extends JPanel implements TableCellRenderer {
         protected Color backgroundColor = Color.PINK; // This means the rows for the first row will be white.
         protected HashMap<Object, Color> rowColors = new HashMap<Object, Color>();
      public SpecialCellRenderer(){
        setOpaque(true);
        setForeground(Color.BLACK);
              setBackground(Color.WHITE);
              setFont(new Font("Monospaced", Font.PLAIN, 10));
              setAlignmentX(Component.RIGHT_ALIGNMENT);
              setBorder(new EmptyBorder(0, 2, 0, 2));
      public Component getTableCellRendererComponent(final JTable table, Object value, boolean isSelected,
                                                                                                                             boolean hasFocus, final int row, final int column){
              String columnName = table.getColumnName(column);
              JLabel text = new JLabel();
              text.setOpaque(true);
              if (table != null){
                   DefaultTableModel model = (DefaultTableModel) table.getModel();
                   if (model == null){
                        System.out.println("The model is null!!");
                        System.exit(1);
                   if (table.isCellSelected(row, column)){
                        setBorder(BorderFactory.createMatteBorder((column < 2) ? 0 : 1,
                                                                                                                                 (column == 2) ? 1 : 0,
                                                                                                                                 (column < 2) ? 0 : 1,
                                                                                                                                 (column == table.getColumnCount() - 1) ? 1 : 0,
                                                                                                                                 Color.BLUE));
                   else{
                        setBorder(BorderFactory.createEmptyBorder());
                   final String rowIdentifier = (String) model.getValueAt(row, 0);
                   if (! rowColors.containsKey(rowIdentifier)){
                        rowColors.put(rowIdentifier, nextBackgroundColor());
                   text.setBackground(rowColors.get(rowIdentifier));
                   text.setFont(getFont().deriveFont(Font.PLAIN));
                   String valueString = (value == null) ? "" : value.toString();
                   text.setText(valueString);
                   try{
                        Double.parseDouble(valueString);
                        text.setHorizontalAlignment(SwingConstants.TRAILING);
                   catch (NumberFormatException nfe){
                        text.setHorizontalAlignment(SwingConstants.LEADING);
                   setLayout(new GridLayout(1, 1));
                   removeAll();
                   add(text);
                   setBackground(text.getBackground());
                   if (table.getRowHeight() < getMinimumSize().height){
                        table.setRowHeight(getMinimumSize().height);
              return this;
         protected Color nextBackgroundColor(){
              backgroundColor = backgroundColor.equals(Color.WHITE) ? Color.PINK : Color.WHITE;
              return backgroundColor;
    }

  • Swing Gurus Help! Problem updating a JProgressBar from within a listener.

    Hello all,
    I have a static JProgressBar attached to the Main JFrame of my application. One of the screens of my app has a JTable on it. I have a ListSelectionListener attached to the table. When an item is selected on the JTable, I pull some information out of it (Using the ListSelectionModel) and kick off a pretty lengthy process. This of course all happens inside the ListSelectionListener. My problem is that when I call into my JFrame (MainFrame.java) to update the ProgressBar, nothing happens.
    The first line of my valueChanged(ListSelecteEvent e) method is
    if (e.getValueIsAdjusting()) return; The next line is call to the progress bar:
    MainFrame.setExecutionProgress(10, "Opening...");When the code is like this, the progress bar isn't updated until after the method valueChanged() method returns. However, if I put the call to setExecutionProgress() before the if (e.getValueIsAdjusting()) check, the progress bar actually changes.
    The second scenario I mentioned above doesn't really help me because subsequent calls to MainFrame.setExecutionProgress() don't work from within the body of the valueChanged() method until it has returned.
    Is this a threading issue? I've tried wrapping calls with SwingUtilitilies.invokeLater(), but I can't get anythin to work. Any ideas?
    Thanks much in advance.
    -Toby

    Where do you kick off this 'lengthy process'? The process is kicked off within the listener. What makes it long is that some of the objects created in this process have to reach out to a web-service for initialization.
    Also, how do you know how far the lengthy process is?Well I create a few projects and just bump the progress meter by 10 or so with each object. I'm not really worried about the accuracy of the progress meter (a la Microsoft =), because I just want to give the user some visual indication something is happening behind the scenes (besides the hour-glass).
    I think I understand how you'd kick this process off in a thread, but how would you create another thread that's capable of monitoring the first? I mean how do you accomplish the inter-thread communication?
    ddinks much for the help!
    -Toby

  • Is there any way to animate a JSlider and a JProgressBar?

    Hi all,
    I'm working on an assignment using JSliders and JProgressBars in a Java application. I've been trying to let my JSlider and JProgressBar move by itself i.e. reset the slider's current value to a new one after a specific period of time...Tried using a timer and thread but just can't seem to get it moving. Is there any way to set the JSlider to update itself after a specified time period? Same goes for JProgressBar?
    At my wits' end, really appreciate if anyone can offer me some advice and help...Thanks.

    Hmm...use a timertask that resets the value and triggers a repaint in the event thread? That should work at least in theory.

  • JProgressBar inside JDialogBox doesn't show up.

    Hi,
    I have a problem and kind of stuck.
    Here is the scenario.....
    Inside my actionPerformed method I create an instance of a class that extends java.lang.Thread and inside this class run method I create an instance of another class that extends JDialog that contains a JProgressBar. Now when a user clicks a button on the main application window the actionPerformed gets executed and it shows a JProgressBar and then continues the execution of the actionPerformed method while the JProgressBar keeps on updating the status. But the problem is that the JDialog shows up but the JProgressBar inside it doesn't even show. here is the code snippet I am using
    public void actionPerformed(ActionEvent e)
    //some code here
    //class extends Thread and creates JDialog with JProgressBar in it
    //JDialogBox with JProgressBar in it shows here
    t = new ProgressThread();
    t.start();
    //some other code I do some other processing
    //here I am hidding and destroying the JProgressBar
    //inside the reset method I hide the JDialog and set it to null
    t.reset();
    //some more code
    } //end of actionPerform
    Now my problem is that JDialogBox does pop-up but the JProgressBar in it doesn't show. Any ideas what I am doing wrong. I even tried to create the instance of JDialog directly instead of using a separate Thread but it didn't work either.
    Thanks for any help

    The point being, AWT and Swing are, in general, not thread-safe.
    You must not do anything that modifies the appearance of any visible Swing component, such as JProgressBar, from your thread. This must be done in the AWT Event Dispatch Thread. But when the components are not visible, like when you are building your GUI and haven't set it to visible yet, this doesn't apply.
    What I do, when my threads need to update the GUI, is to create a Runnable to do it, then queue that to the AWT Event Dispatch Thread for execution by calling SwingUtilities.invokeLater(). Other people use this SwingWorker class.
    Note that event listener methods are called in the AWT Event Dispatch Thread, so you need to worry about this only in your own thread.
    It is said there are some Swing components that are thread-safe. Given the typical use of JProgressBar, too bad it isn't one of them.

  • Prob with JProgressBar and JButton

    Hi, hopefully someone can help me. I have an applet that does some stuff and when it starts the work, it creates a new JFrame with 2 progress bars (JProgressBar), an ok Jbutton and a cancel JButton. The progress bars update properly, thats not an issue, my problem is that when you click either of the buttons, they don't create an actionEvent until the work is completed, which is ok for the OK button but makes the cancel button pretty useless. I have tried suggested work arounds using SwingWorker and the event dispatching thread for similar probs other people have posted on here but with no success. I don't really know a lot about threads which doesn't really help!! Is it likely to be a thread problem or something to do with event queue which has also been suggested to me. Any help would be greatly appreciated.

    public class ProgressDialog extends JDialog implements Runnable
    private JProgressBar progressBar, totalBar;
    private JButton ok, cancel;
    public ProgressDialog()
    setTitle(dialogTitle);
    setBounds(350,300,300,120);
    //setSize(300,100);
    Container contentPane = getContentPane();
    FlowLayout flow = new FlowLayout();
    contentPane.setLayout(flow);
    JLabel label1 = new JLabel(" Upload progress: ");
    contentPane.add(label1);
    progressBar = new JProgressBar(0,100);
    progressBar.setValue(0);
    progressBar.setStringPainted(true);
    contentPane.add(progressBar);
    JLabel label2 = new JLabel(" Total progress: ");
    contentPane.add(label2);
    totalBar = new JProgressBar();
    totalBar.setValue(0);
    totalBar.setStringPainted(true);
    contentPane.add(totalBar);
    ok = new JButton("OK");
    ok.addActionListener(new ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    contentPane.add(ok);
    cancel = new JButton("Cancel");
    cancel.addActionListener(new ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton2ActionPerformed(evt);
    contentPane.add(cancel);
    setVisible(true);
    setResizable(false);
    Thats near enough the whole class now. Thanks

  • Update JFrame via another Thread

    Hello,
    I have a JFrame with a JProgressBar, and I need to see the JProgressBar fill as some operation executes. In that JFrame there's a public method that increments the JProgressBar. This serves as a GUI to another class. That other class receives, as an argument, the JFrame, in order to be able to call that public method to increment the JProgressBar.
    Something like:
    public class Worker{
       public Worker(JFrame jf){
          this.frame = jf;
       public doWork(){
          instruction1;
          frame.updateProgressBar();
          instruction2;
          frame.updateProgressBar();
    }This has a major problem: the JFrame's graphics won't be updated (you won't see the progress bar filling during the operation). So I made a class to run the Worker on a Thread, that looks something like:
    public class WorkerThread extends Thread{
       public WorkerThread (Worker w){
          this.worker= w;
       public void run(){
          w.doWork();    
    }This got the problem solved, the JProgressBar is now correctly updated. But it created a new problem: I need the JFrame to wait for the WorkerThread to finish, and that's what I'm having real trouble with:
    public class GUI extends JFrame{
       private worker = new Worker();
       void someButtonPressed(...){
          WorkerThread wt = new WorkerThread(worker);
          wt.start();
          System.out.println("I don't want to see this until the Thread finishes");
    }If I leave this as is, I'll see the text before the Thread finishes.
    So I added "wait()" between the last two instructions, and a "notify()" as the last instruction of the run() method on WorkerThread. Unfortunately, this gives me two exceptions (java.lang.IllegalMonitorStateException: current thread not owner), one when I call wait() and another when I call notify(). If I make the two methods that call wait() and notify() synchronized, the JFrame's graphics won't update correctly (back to the initial problem).
    Any suggestions? Sorry for the long post, and thanx in advance! :)

    I don't really understand why you are using two JFrames.
    Typically in an application you have a single main JFrame. Whenever you need additional information you would create and display a "modal" JDialog. A modal JDialog prevents the JFrame from receiving any events. So in your example the progress bar should be added the dialog. When the long running task is finished you close the dialog an execution continues back in your main JFrame.

  • Progress bar in a JProgressBar component is not always drawn

    Hi experts,
    I have a strange issue with a swing application. This app contains of a JFrame including a JTable. This table has multiple columns, one of them is a JProgressBar (implementing a TableCellRenderer). Multiple background threads are running, every of them updates one row's progress bar via the InvokeLater() method. This works fine.
    At a specific point within the runtime of the application, the value of a progress bar is set back to 0, and instead of the default percentage text a custom string is displayed (then continuing to progress with this custom text set). This works fine as well.
    Problem is, that when a custom string is set to one progress bar as described above, then the bars of the other JProgressBars are not painted any more. But the default percentage text of these other JProgressBars are still incremented and painted correctly. When the one progress bar, that has the custom string set, has finished and this row is removed from table, then the other progress bars are again painted correctly (including the default percentage text).
    A part of the custom TableCellRenderer class is shown here:
         public class ProgressRenderer extends JProgressBar implements TableCellRenderer
         public ProgressRenderer()
              super(SwingConstants.HORIZONTAL);
              setBorderPainted(false);
              setStringPainted(true);
         public Component getTableCellRendererComponent(JTable table, Object value,
              boolean isSelected, boolean hasFocus, int row, int column)
              if(value != null)
                   setValue(((JProgressBar) value).getValue());
                   setString(((JProgressBar) value).getString());
                   setMinimum(((JProgressBar) value).getMinimum());
                   setMaximum(((JProgressBar) value).getMaximum());
              return this;
    ...Any ideas what could be wrong here?
    I am really out of ideas here :(
    Thanks in advance for your help!
    Kind regards, Matthias

    I have solved the problem:
         public Component getTableCellRendererComponent(JTable table, Object value,
              boolean isSelected, boolean hasFocus, int row, int column)
              if(value != null)
                   setString(((JProgressBar) value).getString());
                   setMinimum(((JProgressBar) value).getMinimum());
                   setMaximum(((JProgressBar) value).getMaximum());
                   setValue(((JProgressBar) value).getValue());
              return this;
         }

Maybe you are looking for

  • Low resolution Illustrator file needs to be changed to high resolution?

    I created a logo for a client in Illustrator that they were going to use on large format banners.  The file contained one Photoshop image that I  imported into my Illustrator file and changed into a vector object.  I also outlined all type.  The only

  • Lion Server setup & Time Capsule

    Greetings, I am new to lion server so please bear with me. Some of my question me seem dumb to some of you. But to me the only dumb question is one not asked. So please bear with me. Server and time capsule will both do NAT, DHCP. Which should I use

  • Process of Adobe Reader XI, is running in the Background, after closing.

    Hi, when I close the Adobe Reader XI, the Process is still running in the Background of my System. The Process needs a lot of CPU an after some moment my System is slowing down rapidly. Windows 8 (64-bit) Adobe Reader 11. What's to do? Greetings

  • JQuery Ui draggable not working in iOS app

    Hey there, I have built an iOS mobile app using EA and PGB. I have an element which uses jQuery Ui's draggable function. It works perfectly in a web browser but in the final app I am unable to drag the element. I have tried loading the script with bo

  • First time use question.

    Hi I bought a Toshiba Satellite L450D-11X off Currys.co.uk and it arrived today. However it seems to be taking hours to install all the toshiba software? is this normal or has it locked? It has been on a grey screen with a scroll bar saying "Please w