Recently I have encountered the issue of trying to add a GUI into my game using Swing. The game will randomly & infrequently flash the jButton or Swing component when I add it to my jFrame. I'm not sure if this is because Swing is not double buffered like the rest of my graphics or something is interfering with Swing (The game is in a barebone state, so I'm not sure what in the game would cause this).
I noticed that Minecraft has it's own custom GUI components, should I do a similar system, or is there an alternative to Swing?
EDIT: Figured I should add the initialization code for the component.
@Override
public void init(Main main) {
playButton = new JButton("Test", new ImageIcon(this.getClass().getResource("gui/BlankButton.png")));
playButton.setLocation(main.getW() / 2, main.getH() / 2);
main.add(playButton);
}