I have 3 separate questions. I'm trying to develop a program that displays several vocabulary lists and has a row of buttons at the top for selecting the lists. These buttons don't appear until I re-size the window. Does anyone know why this occurs? Second, I've extended the JPanel class to implement the Mouse Listener event listener. The main class declaration, which extends the JFrame class, implements an Action Listener. Is there any way to implement both listeners in the main class declaration? Third and finally, I've attempted to draw a test string on an extension of a JPanel, but nothing shows up. Again, what am I doing wrong? I've attached the appropriate .java file if you need it, rather than just waste a bunch of space on this thread with my code. Any help would be greatly appreciated.
nocookies92
0
Newbie Poster
Recommended Answers
Jump to Post(1) The buttons show up in my machine (JDK 1.6). So it seems to be some problem with your machine. You may use Button of AWT rather than JButton of swing which is a lightweight component and does not show up among any AWT stuff. However, your case is OK. …
Jump to PostFirst thing: setVisible AFTER the GUI has been built.
Another way to toggle a boolean is to set it to its ! value;
showeng = !showeng; // toggle flag
All 5 Replies
tong1
22
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
new_programmer
0
Junior Poster in Training
nocookies92
0
Newbie Poster
new_programmer
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.