For my computer science class, I have to write a Java program that has a GUI (more specifically, a Java video game that has a GUI). I played with GUI programming a bit when Microsoft sent me a free copy of Visual Basic 2003 .NET a few years ago and it was really easy as I could drag and drop controls into a window, position them as I wanted and set a bunch of fields indicating the behaviors, appearance, etcetera of everything. Is there any way to get this sort of thing in a Java IDE or is GUI programming in Java supposed to be a hellish experience?
I am having trouble getting text in labels to wrap. For some reason it only wants to be on one line. Is there any easy way to get text with which the user is not supposed to interact to wrap automatically without manually wrapping it? I found a blog entry that has a well written hack for doing this, but I will be subject to academic dishonesty proceedings if I use other people's code, so I need some other way of doing this, assuming I don't just go and manually wrap text:
http://www.geekyramblings.org/2005/06/30/wrap-jlabel-text/I am also having trouble with using HTML in JLabels to format text that is supposed to be inert as far as the user can tell. If I have paragraph tags, their contents are put on separate lines as if I had used a line break tag, rather than being placed two lines apart. I have tried specifying the default stylesheet Firefox uses for paragraphs and headers, but it does not seem to respond to that. Is there a way to get it to extremely simple HTML to render as it does in Firefox/Opera/Google Chrome/<Insert Any Almost Standards Complaint Browser here>?
Getting a menu bar to behave similarly to its Windows Forms counterpart in that it responds to alt presses such that the first menu in it will be selected but the menu will not expand without the down arrow key being pressed seems impossible. Is there any way to get a menu bar to behave like its Windows Forms counterpart in Java?
I wanted to make a wizard for my program and I have created a set of classes for making Wizards. The basic idea is that I have a class that extends JDialog in whose content pane I am swapping JPanels as the next and previous buttons are pressed. If I do not change the text of a button in the dialog when the next button is pressed, repaint() will not display the contents of the new panel. What does changing the text of a JButton do that repaint() does not when a panel inside of the content pane of a JDialog is removed and another is added in its place? Also, did I really need to write a bunch of classes just to get a Wizard to work or has this work already been done for me by the Java library writers' encyclopedic approach to writing libraries?
I want to organize sets of controls to be arranged in a tabular layout, such that they are organized into rows and columns, and have a header describing each column. Is there a way to do this without hacking away at obscure portions of the Java API that few people understand for weeks?