Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create a custom Swing Component
    primarykey
    data
    text
    <p>I've always wanted to create custom components in Java, or customize existing ones, but my searches never resulted in anything useful. So I decided to ask the StackOverflow community:</p> <p><strong>Where can I find information about customizing Java GUI Components in general?</strong></p> <p>And when I mean customizing, I'm not talking about changing colors, fonts etc. I mean <strong>really</strong> customize them. Here are two mockup example components:</p> <p><img src="https://i.stack.imgur.com/t36RA.jpg" alt="Custom Components Mockup"></p> <p><strong>Notes</strong><br> I started this question mainly to find how to create the above two custom components. But then I realized that there isn't a general question about hacking swing components. So I thought it would be better to have a list of resources.</p> <p>In case you are wondering how do the two components in the mockup work, here it is:</p> <p>A customized JScrollPane that has two Scrollbars for each orientation. Each scrollbar can act differently. For example, the outer ones scroll normally and the inner ones move the view in a more <a href="http://picasa.google.com/" rel="nofollow noreferrer">Picasa</a>-like way. I actually got a working(!) answer from google groups <a href="http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a3c3558d7924661/11e7beb95c003575?#11e7beb95c003575" rel="nofollow noreferrer">here</a>, but that was just code.</p> <p>The second one is a custom JComboBox which, when the popup list is expanded, has a JComponent at the end. This can be anything, from a simple JLabel with an icon, to a JButton that manipulates the list in a way.</p> <p>But this question isn't about those specific components. It's about <strong>finding resources (websites, books, articles etc.) to learn how to create them</strong>. </p>
    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.
 

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