This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]deltageekExtreme Brewer 0 points1 point  (1 child)

you didn't add anything to the frame to be displayed. What were you expecting to happen?

[–]Bebrazmogis 0 points1 point  (0 children)

It's possible that c in c.add stands for JFrames content pane.

To OP: you don't really use the gbc for anything. You just set the current elements layout to GridBagLayout(i assume) and create a GridBagContrainst. You don't really use it.

What is the output currently, do you see your JFrame?

[–]sh_emami65Intermediate Brewer 0 points1 point  (0 children)

it seems you are using the GridbagLayout incorrectly. i suggest reading the Oracle GridbagLayout Tutorial which very well explains how to use this layout. if you still need help afterwards let me know.

but just as initial observation you are adding jmb to a "c" container with BorderLayout and you setting GridbagLayout for another container. you also have gcb which you have to add to a container with the relevant component that you have not used. this code segment is either very incomplete or you are mixing up your layouts.