/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { popupText = new javax.swing.JTextArea(); setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); setLayout(new java.awt.BorderLayout()); popupText.setBackground(new java.awt.Color(204, 204, 204)); popupText.setColumns(20); popupText.setEditable(false); popupText.setLineWrap(true); popupText.setRows(1); popupText.setWrapStyleWord(true); popupText.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); add(popupText, java.awt.BorderLayout.PAGE_START); }// </editor-fold>//GEN-END:initComponents
/** Creates new form TextPopup */ public TextPopup() { initComponents(); }
tooltipText.setText(getText(cardType));
private void showTooltipPopup(final TransferData data, final Component parentComponent, final Point parentPoint) { if (data.component != null) { tooltipDelay = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_DELAY, 300); if (tooltipDelay == 0) { return; } } if (cardInfoPane == null) { PopupFactory factory = PopupFactory.getSharedInstance(); if (data.locationOnScreen == null) { if (data.component == null) { return; } data.locationOnScreen = data.component.getLocationOnScreen(); } data.popupText.updateText(); tooltipPopup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); tooltipPopup.show(); // hack to get popup to resize to fit text tooltipPopup.hide(); tooltipPopup = factory.getPopup(data.component, data.popupText, (int) data.locationOnScreen.getX() + data.popupOffsetX, (int) data.locationOnScreen.getY() + data.popupOffsetY + 40); tooltipPopup.show(); } else { sumbitShowPopupTask(data, parentComponent, parentPoint); } }
tooltipText.setText(getText(cardType, card));