javax.swing.JPanel#setLocation ( )源码实例Demo

下面列出了javax.swing.JPanel#setLocation ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码4 项目: TencentKona-8   文件: javax_swing_JLayeredPane.java
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}
 
源代码5 项目: jdk8u-jdk   文件: CursorOverlappedPanelsTest.java
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码6 项目: jdk8u60   文件: javax_swing_JLayeredPane.java
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}
 
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码8 项目: openjdk-jdk8u   文件: javax_swing_JLayeredPane.java
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}
 
源代码9 项目: chipster   文件: SplashScreen.java
public SplashScreen(Icon icon) {
	frame = new JFrame();
	frame.setLayout(null);
	frame.setUndecorated(true);		
	frame.setSize(icon.getIconWidth(), icon.getIconHeight()+TEXT_HEIGHT);
	frame.setLocationRelativeTo(null);  
	frame.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
	frame.getRootPane().setBorder(new LineBorder(VisualConstants.SPLASH_BORDER_COLOR, 1));
	
	JLabel imageLabel = new JLabel(icon);
	imageLabel.setSize(icon.getIconWidth(), icon.getIconHeight());
	frame.add(imageLabel);
	imageLabel.setLocation(0, 0);
	textLabel = new JLabel();
	textLabel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
	
	textLabel.setFont(VisualConstants.SPLASH_SCREEN_FONT);
	
	textPanel = new JPanel(new BorderLayout());
	textPanel.setLocation(0, icon.getIconHeight());
	textPanel.setSize(icon.getIconWidth(), TEXT_HEIGHT);
	textPanel.setBackground(Color.WHITE);
	textPanel.setOpaque(true);
	textPanel.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, VisualConstants.SPLASH_BORDER_COLOR));
	textPanel.add(textLabel);
	
	frame.add(textPanel);
	frame.setVisible(true);
}
 
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}
 
源代码11 项目: openjdk-jdk9   文件: CursorOverlappedPanelsTest.java
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码12 项目: openjdk-jdk9   文件: javax_swing_JLayeredPane.java
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}
 
源代码13 项目: jdk8u-jdk   文件: CursorOverlappedPanelsTest.java
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码14 项目: jdk8u_jdk   文件: CursorOverlappedPanelsTest.java
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码15 项目: hottub   文件: CursorOverlappedPanelsTest.java
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码16 项目: moa   文件: GraphCanvas.java
private void addComponents() {

        axesPanel = new GraphAxes();
        curvePanel = new GraphCurve();
        eventPanel = new JPanel();

        curvePanel.setLocation(x_offset_left + 1, y_offset_top);
        eventPanel.setLocation(x_offset_left + 1, 0);
        eventPanel.setLayout(null);

        add(axesPanel);
        axesPanel.add(curvePanel);
        axesPanel.add(eventPanel);

    }
 
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码18 项目: jdk8u-jdk   文件: javax_swing_JLayeredPane.java
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}
 
源代码19 项目: openjdk-8   文件: CursorOverlappedPanelsTest.java
private static JPanel createPanel(Point location, boolean enabled) {
    final JPanel panel = new JPanel();
    panel.setOpaque(false);
    panel.setEnabled(enabled);
    panel.setSize(new Dimension(200, 200));
    panel.setLocation(location);
    panel.setBorder(BorderFactory.createTitledBorder(
            enabled ? "Enabled" : "Disabled"));
    panel.setCursor(Cursor.getPredefinedCursor(
            enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    System.out.println("cursor: " + Cursor.getPredefinedCursor(enabled ? Cursor.CROSSHAIR_CURSOR : Cursor.DEFAULT_CURSOR));
    return panel;
}
 
源代码20 项目: openjdk-8   文件: javax_swing_JLayeredPane.java
private static void init(JLayeredPane pane, int layer, int x, int y, int w, int h, Color color) {
    JPanel panel = new JPanel();
    panel.setBackground(color);
    panel.setLocation(x, y);
    panel.setSize(w, h);
    pane.add(panel, new Integer(layer));
}