zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    Xtreme9.0
    Xtreme8.0
    Xtreme8.0
    Xtreme8.0
    Xtreme9.0
    Xtreme8.0
    IEEEXtreme Practice Community Xtreme9.0
    MySQL添加用户、删除用户与授权
    程序员进阶之路—如何独当一面
    PowerDesigner版本控制器设置权限
  • 原文地址:https://www.cnblogs.com/borter/p/9596121.html
Copyright © 2011-2022 走看看