e739. 创建一个标签组件

Posted borter

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

以上是关于e739. 创建一个标签组件的主要内容,如果未能解决你的问题,请参考以下文章

Codeforces.739E.Gosha is hunting(DP 带权二分)

739. 每日温度 : 单调栈模板题

LeetCode:每日温度739

使用 function 构造函数创建组件和使用 class 关键字创建组件

spring自定义标签

思维-CF-739A