| 56 | JLabel previewLabel=new JLabel(new ImageIcon("prevstart.jpg")); |
| 57 | |
| 58 | public ProgressFrame(int LengthOfTask) { |
| 59 | super(new BorderLayout()); |
| 60 | //task = new LongTask(); |
| 61 | |
| 62 | |
| 63 | ImageIcon i=new ImageIcon(); |
| 64 | |
| 65 | progressBar = new JProgressBar(0, LengthOfTask); |
| 66 | progressBar.setValue(0); |
| 67 | progressBar.setStringPainted(true); |
| 68 | |
| 69 | taskOutput = new JTextArea(5, 20); |
| 70 | taskOutput.setMargin(new Insets(5,5,5,5)); |
| 71 | taskOutput.setEditable(false); |
| 72 | taskOutput.setCursor(null); //inherit the panel's cursor |
| 73 | //see bug 4851758 |
| 74 | |
| 75 | //Create and set up the content pane. |
| 76 | JPanel pane=new JPanel(new BorderLayout()); |
| 77 | JPanel progressPanel = new JPanel(new BorderLayout()); |
| 78 | progressPanel.add(progressBar,BorderLayout.NORTH); |
| 79 | progressPanel.add(new JScrollPane(taskOutput),BorderLayout.CENTER); |
| 80 | // progressPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); |
| 81 | |
| 82 | pane.add(progressPanel,BorderLayout.NORTH); |
| 83 | JPanel previewPanel =new JPanel(new BorderLayout()); |
| 84 | previewPanel.add(new JLabel("last frame:"),BorderLayout.WEST); |
| 85 | //previewLabel.setSize(100,100); |
| 86 | previewPanel.add(new JScrollPane(previewLabel),BorderLayout.CENTER); |
| 87 | pane.add(previewPanel,BorderLayout.CENTER); |
| 88 | // System.out.println("dsfkgreg--------------"); |
| 89 | JPanel controlPanel=new JPanel(new GridLayout(1,3)); |
| 90 | |
| 91 | playMovieButton.setEnabled(false); |
| 92 | controlPanel.add(playMovieButton); |
| 93 | cancelButton.addActionListener(new ActionListener(){ |
| 94 | public void actionPerformed(ActionEvent ae){ |
| 95 | processCanceled=true; |
| 96 | } |
| 97 | |
| 98 | }); |
| 99 | controlPanel.add(cancelButton); |
| 100 | // controlPanel.add(closeButton); |
| 101 | pane.add(controlPanel,BorderLayout.SOUTH); |
| 102 | // newContentPane.setOpaque(true); //content panes must be opaque |
| 103 | //frame.setContentPane(pane); |
| 104 | |
| 105 | |
| 106 | //JPanel panel = new JPanel(); |
| 107 | //panel.add(progressBar); |
| 108 | |
| 109 | add(pane, BorderLayout.CENTER); |
| 110 | //add(new JScrollPane(taskOutput), BorderLayout.CENTER); |
| 111 | setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); |
| 112 | |
| 113 | |
| 114 | } |
| 115 | |