|
package jcredito;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.*;
import javax.swing.*;
public class Order extends JFrame{
private JTabella T ;
super("");
this. setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE);
this.user = us;
p. setBackground(new Color(0, 60, 120 ));
p2. setBackground(new Color(0, 60, 120 ));
l1. setFont(new Font("Arial", Font. BOLD, 14 ));
l1. setForeground(Color. ORANGE);
l2. setFont(new Font("Arial", Font. BOLD, 14 ));
l2. setForeground(Color. ORANGE);
p.add(l1);
p.add(comboday);
p.add(combomese);
p.add(comboanno);
p.add(l2);
p.add(comboday2);
p.add(combomese2);
p.add(comboanno2);
initCombo();
cb. setFont(new Font("Arial", Font. BOLD, 14 ));
cb. setForeground(Color. ORANGE);
cb. setBackground(new Color(0, 60, 120 ));
p2.add(cb);
p2.add(view);
JLabel l3 = new JLabel("Visualizza tutto o in data predefinita");
l3. setFont(new Font("Arial", Font. BOLD, 14 ));
l3. setForeground(Color. ORANGE);
p3. setBackground(new Color(0, 60, 120 ));
p3.add(l3);
this.getContentPane().add(p3, "North");
this.getContentPane().add(p, "Center");
this.getContentPane().add(p2, "South");
this.setResizable(false);
this.setVisible(true);
this.setBounds(360, 200, 400, 200);
this.pack();
view.addActionListener(
if (cb.isSelected()) {
T = new JTabella(user);
} else {
T = new JTabella(user, comboday.getSelectedItem() + "/" + combomese.getSelectedItem() + "/" + comboanno.getSelectedItem(), comboday2.getSelectedItem() + "/" + combomese2.getSelectedItem() + "/" + comboanno2.getSelectedItem());
}
}
});
}
public void initCombo() {
int i;
for (i = 1; i < 32; i++) {
comboday. addItem(String. valueOf(i ));
comboday2. addItem(String. valueOf(i ));
}
for (i = 1; i < 13; i++) {
combomese. addItem(String. valueOf(i ));
combomese2. addItem(String. valueOf(i ));
}
for (i = 2010; i < 2051; i++) {
comboanno. addItem(String. valueOf(i ));
comboanno2. addItem(String. valueOf(i ));
}
comboday2. select(gc. get(Calendar. DATE) - 1 );
combomese2. select(gc. get(Calendar. MONTH));
i = 2010;
int j = 0;
while (i < 2051) {
if (String. valueOf(i ). equals(comboanno2. getItem(j ))) {
break;
}
j++;
i++;
}
comboanno2.select(j);
}
}
|
|