javaのcomboBoxでデーターの右寄表示
javaのcomboBoxで表示データーの右寄せ表示について質問します。
Q1)下記のコードでどの様に変更すれば良いでしょうか?
======================
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class comboBox_Right extends JFrame {
public static JComboBox[] combo=new JComboBox[4];
static comboBox_Right frame;
public static void main(String args[]){
frame=new comboBox_Right("AAAA");
frame.setVisible(true);
}
comboBox_Right(String title) {
setTitle(title);
setBounds(100, 100, 300, 420);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel p = new JPanel();
//========================================
//ComboBox data
String[][] combodata = { {"A0", "B0", "C0", "D0"}, //No.1 Combo
{"A1", "B1", "C1", "D1"}, //No.1 Combo
{"A2", "B2", "C2", "D2"}, //No.1 Combo
{"A3", "B3", "C3", "D3"}, //No.1 Combo
};
for(int i=0; i<4; i++){
combo[i] = new JComboBox(combodata[i]); //make 4 comboBox
combo[i].setPreferredSize(new Dimension(175, 25)); //ComboBox Size
}
//===============
for(int i=0; i<4; i++) p.add(combo[i]); //add 4 comboBox
//===============
Container contentPane = getContentPane();
contentPane.add(p, BorderLayout.CENTER);
}
}
===============================
以上、宜しくお願いします。