Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>See the <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/intro.html" rel="nofollow noreferrer">Introduction to DnD</a> in the tutorial to develop some code that works. </p> <hr> <blockquote> <p><em>Please see the screenshot on the first post to see what is a specification of nice.</em> </p> <p>The only custom part is the dashed border of the downward pointing arrow, and the text below it. You might use an icon (for the arrow/border) in a <code>JLabel</code> with HTML formatting for the text, to achieve that. </p> </blockquote> <h2>E.G.</h2> <p><img src="https://i.stack.imgur.com/KeWhy.png" alt="Icon with HTML formatted text in label"></p> <pre><code>package test.t100.t006; import javax.swing.Icon; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.UIManager; public class DrawLabel { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run() { // substitute for downward pointing arrow with dashed border Object obj = UIManager.getDefaults() .get("OptionPane.warningIcon"); if (obj!=null &amp;&amp; obj instanceof Icon) { Icon icon = (Icon)obj; String text = "&lt;html&gt;&lt;body&gt;Drag &lt;em&gt;&lt;b&gt;Stuff&lt;/b&gt;&lt;/em&gt; Here"; JLabel l = new JLabel( text, icon, SwingConstants.HORIZONTAL); l.setVerticalTextPosition(SwingConstants.BOTTOM); l.setHorizontalTextPosition(SwingConstants.CENTER); JOptionPane.showMessageDialog( null, l); } } }); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload