473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Java GUI help please

I have a frame with buttons on it, and everything works except for one thing. When I run the program, the frame is empty. When I resize the window in any way, then the buttons appear. How can I make the buttons appear from the get-go?

Thanks
Jan 2 '08 #1
5 1080
I have a frame with buttons on it, and everything works except for one thing. When I run the program, the frame is empty. When I resize the window in any way, then the buttons appear. How can I make the buttons appear from the get-go?

Thanks


Might be Frame is not having layout.I mean frame is in "null layout".Set a layout for the frame
for Ex:
this.getContentPane().setLayout(new FlowLayout());

Then buttons will come into picture when you minimize,maximize and resize also
Jan 2 '08 #2
BigDaddyLH
1,216 Expert 1GB
In these cases, just describing the problem isn't the best way to get help. The best way to get help is to post a SSCCE, a Short Self-Contained Compilable Example:

http://mindprod.com/jgloss/sscce.html
Jan 2 '08 #3
I have a frame with buttons on it, and everything works except for one thing. When I run the program, the frame is empty. When I resize the window in any way, then the buttons appear. How can I make the buttons appear from the get-go?

Thanks
whether you have added the buttons using add()?
Jan 3 '08 #4
BigDaddyLH
1,216 Expert 1GB
whether you have added the buttons using add()?
Guessing is unlikely to help the original poster or help other forum members who come looking for help for a similar problem. The original poster needs to write a SSCCE.
Jan 3 '08 #5
Thanks for your answers everyone. A friend of mine helped me solve the problem so it's all good now. I just joined and this is my first post--I previously didn't know about SSCCE. Now I know, and in the future I will post code.
Jan 4 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Ash | last post by:
Hey. Im new to Java, and am having a prroblem with the netbeans IDE. every time i try to import java.awt.* , I can't use any of the methods(like they don't exist). I can compile it fine, but when I...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
13
by: Andrew Bell | last post by:
I'm doing a uni course in the UK and one of my semesters is about programming. This is just going to be compilied and executed with no menu just using command promt (javac classfile.class) I am...
2
by: ramasubramanian.rahul | last post by:
hi i am trying to call some java APIs from c . i use the standatd JNI calls to load the JVM from a c program and call all java functions by using a pointer to the jvm which was returned by the JNI...
0
by: south622 | last post by:
I'm taking a beginning Java course and I'm stuck in week eight of a nine week course. If anyone could help me I would greatly appreciate it. This assignment was due yesterday and each day I go past...
0
by: vidhyasreddy | last post by:
Hi All, While we are Localizing our product we faced below problem: java.awt components not able to display some non-english charecters like \u2019 , \u2018 , \u2026 , \u2013 , \u8230 . ...
2
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: ...
1
by: onlinegear | last post by:
HI i am writing this for college i know i have loads of combo boxes with nothing in the i havent got that far yet. but every time i run this is comes up with this erro run: Exception in thread...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.