I'm working on a 2D RPG game and am currently working on a dialogue window that pops up, to prompt the user to enter the quantity of a given item they would like to buy/sell in a shop. For this I need the user to be able to provide a number as input.
I've read some docs on JTextFields, but I'm mostly using my own graphics in this game, drawing to the screen with a Graphics object and don't want to use the standard Java JTextField Swing graphics, as it would be out of place. I have my own, fully working, KeyManager handler class that handles keyboard input in my game. Do you know of any approaches that would allow me to make custom text fields, which are focusable (to type in)?
Another question I have is: Is it possible to remove the JTextField border and set the background to full transparent, so only the cursor for typing is visible and I can add my own implementations of a "textbox"?
Then finally: My game opens with a JFrame and the graphics are drawn to a Canvas. A JTextField should be added to a JFrame, to a JPanel, right? If this is the case, should my DialogueWindow class extend a new JFrame and contain a JPanel to add the JTextField to or do I have to add this to my existing JFrame?
I have little experience with using the Swing library, so hoping someone can answer these questions for me.
tl;dr:
I don't want my input field to look like the standard JTextField below, how to implement my own without using the standard Swing graphics?