ここに関数があります:
/**
* Creates an instance of a JLabel with the given arguments
* @param text The text to be displayed on the Label
* @param font The font of the label
* @param bold set to true if you want the label's text to be bold
* @param fontSize The size of the font to be rendered
* @param alignment An alignment (E.g. CENTER_ALIGNMENT)
* @param verticleAlignment an optional argument to allow one to choose the Y alignment
* **/
public JLabel createLabel(String text, String font, boolean bold, int fontSize, float alignment, float...verticleAlignment){
JLabel label = new JLabel(text);
label.setFont(new Font(font, bold ? Font.BOLD : Font.PLAIN, fontSize));
label.setAlignmentX(alignment);
if(verticleAlignment.length > 0){
label.setAlignmentY(verticleAlignment[0]);
}
return label;
}
なんらかの理由で、varArg verticleAlignment に何を入力しても、実際には適用されないのですか?
add(createLabel("ChatBytes™ - Do not steal.", "Arial", false, 12, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT));
関数の setYAlignment 部分を無視する理由を誰でも見ることができますか?