e739. 创建一个标签组件

    // The text is left-justified and vertically centered
JLabel label = new JLabel("Text Label"); // The text is horizontally and vertically centered
label = new JLabel("Text Label", JLabel.CENTER); // The text is right-justified and vertically centered
label = new JLabel("Text Label", JLabel.RIGHT); // The text is left-justified and top-aligned
label = new JLabel("Text Label", JLabel.LEFT);
label.setVerticalAlignment(JLabel.TOP); // The text is right-justified and top-aligned
label = new JLabel("Text Label", JLabel.RIGHT);
label.setVerticalAlignment(JLabel.TOP); // The text is left-justified and bottom-aligned
label = new JLabel("Text Label", JLabel.LEFT);
label.setVerticalAlignment(JLabel.BOTTOM); // The text is right-justified and bottom-aligned
label = new JLabel("Text Label", JLabel.RIGHT);
label.setVerticalAlignment(JLabel.BOTTOM);
Related Examples
上一篇:[BZOJ5073] [Lydsy1710月赛]小A的咒语 后缀数组+dp+贪心


下一篇:mybatis 框架动态传入参数${}和#{}之间的区别