ulysse00
Messages postés291Date d'inscriptionlundi 6 novembre 2006StatutMembreDernière intervention12 mai 2013
-
6 août 2010 à 19:15
ulysse00
Messages postés291Date d'inscriptionlundi 6 novembre 2006StatutMembreDernière intervention12 mai 2013
-
10 août 2010 à 13:27
salut
mon JProgressBar ne fonctionne pas voila le code si je tape sur le bouton rien ne passe
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.Font;
import javax.swing.JComboBox;
public class bar extends JFrame {
final JDialog d = new JDialog(this, "Progress Dialog", true);
private JPanel jContentPane = null;
private JPanel jPanel = null;
int k =0;
private JButton jButton = null;
private JLabel jLabel = null;
int g;
int nombreLignes;
private JPanel getJPanel() {
if (jPanel == null) {
jLabel = new JLabel();
jLabel.setBounds(new Rectangle(131, 37, 111, 40));
jLabel.setText("JLabel");
jPanel = new JPanel();
jPanel.setLayout(null);
jPanel.setBounds(new Rectangle(10, 7, 266, 109));
jPanel.add(getJButton(), null);
jPanel.add(jLabel, null);
}
return jPanel;
}
private JButton getJButton() {
if (jButton == null) {
jButton = new JButton();
jButton.setBounds(new Rectangle(15, 34, 99, 45));
jButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
final JProgressBar dpb = new JProgressBar(0,g);
d.add(BorderLayout.CENTER, dpb);
d.add(BorderLayout.NORTH, new JLabel("Progress..."));
d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
d.setSize(300, 75);
public static void main(String[] args) {
// TODO Auto-generated method stub
SwingUtilities.invokeLater(new Runnable() {
public void run() {
bar thisClass = new bar();