Java Swing Tooltip createMarker(int span, String tooltip)

Here you can find the source of createMarker(int span, String tooltip)

Description

create Marker

License

Apache License

Declaration

static JComponent createMarker(int span, String tooltip) 

Method Source Code


//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.awt.Color;
import javax.swing.JComponent;
import javax.swing.JLabel;

public class Main {
    static final private String MARKER_LABEL = "spanRow()";
    static final private String MARKER_NAME = "DesignGridLayout.spanRow-Marker";

    static JComponent createMarker(int span, String tooltip) {
        JLabel marker = new JLabel(MARKER_LABEL);
        marker.setName(MARKER_NAME);/*from w  w  w .  j a  v a2s.co m*/
        marker.setHorizontalAlignment(JLabel.CENTER);
        marker.setOpaque(true);
        marker.setBackground(Color.RED);
        marker.setToolTipText(tooltip);
        return marker;
    }
}

Related

  1. addClickTipEffect(final JComponent component)
  2. createNumericInput(final String tooltip)
  3. displayTooltip(JComponent component)
  4. hideToolTip(JComponent c)
  5. performMultipleReplacements(final Document theDocument, final String theRegexToSearch, final String theReplacement)