The JXTitledSeparator constructor takes no parameters. Use #setTitle(), #setIcon() to provide a title, icon and #setHorizontalAlignment(), #setHorizontalTextPosition() for adjustment.
All relevant lines are highlighted. Press the "Run..." button to start the example.