javax.swing.JComponent.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中javax.swing.JComponent.<init>()方法的一些代码示例,展示了JComponent.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.<init>()方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:<init>

JComponent.<init>介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) {
  JComponent component = new JComponent() {};
  System.out.println("JComponent = " + component.getLayout());

  JPanel panel = new JPanel();
  System.out.println("JPanel = " + panel.getLayout());
}

代码示例来源:origin: stackoverflow.com

JComponent image = new JComponent ()

代码示例来源:origin: stackoverflow.com

BufferedImage img = ImageIO.read(new File("test.png"));
JComponent component = new JComponent() {
  protected void paintComponent(Graphics graphics) {
    graphics.drawImage(img, 0, 0, null);
  };
};
component.addMouseListener(new MouseAdapter() {
  public void mouseClicked(MouseEvent e) {
    shiftToBlack(img);
    component.repaint();
  }
});
JFrame frame = new JFrame("test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(component);
frame.pack();
frame.setSize(150, 150);
frame.setVisible(true);

代码示例来源:origin: stackoverflow.com

content.setLayout(new OverlayLayout(content));
frame.add(content);
JComponent glassPane = new JComponent(){};
content.add(glassPane);
final JPanel bg = new JPanel(new BorderLayout());

代码示例来源:origin: stackoverflow.com

final JComponent component = new JComponent ()

代码示例来源:origin: stackoverflow.com

import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class Main {
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        JFrame frame = new JFrame();
        JComponent chart = new Board("1");

        frame.setSize(600, 600);
        frame.setTitle("SleutelBarricade");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setLocationRelativeTo(null);
        frame.add(chart);
        frame.setVisible(true); 
      }
    });
  }
}

代码示例来源:origin: stackoverflow.com

directionData.add ( true );
final JComponent canvas = new JComponent ()

代码示例来源:origin: google/sagetv

setLayout(new java.awt.BorderLayout());
add(new javax.swing.JLabel(name), "West");
add(colorSample = new javax.swing.JComponent()

代码示例来源:origin: stackoverflow.com

final JComponent component = new JComponent ()

代码示例来源:origin: stackoverflow.com

glassPane.setVisible ( true );
JComponent popup = new JComponent ()

相关文章

JComponent类方法