Iam试图将我的jlabel定位在一个jpanel中,因为actionlistener是最终的。
final JPanel panelPayDetails = new JPanel();
panelPayDetails.setBounds(250, 25, 350, 250);
JLabel lblnumber = new JLabel("Insert Number:");
lblnumber.setFont(Applicatie.FONT_12_BOLD);
lblnumber.setBounds(5, 5, 200, 20);
panelPayDetails.add(lblnumber);
panelPayDetails.setVisible(false);
jpExtraDetails.add(panelPayDetails);
bill.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
if(bill.getSelectedItem() == "CREDIT CARD")
{
panelPayDetails.setVisible(true);
}
}
});
到目前为止,我不是运气..因为标签位于jpanel的中间..怎么来的?