Skip to content
Advertisement

Tag: swing

Selecting a part of text in JSpinner on click

I have a JSpinner with SpinnerDateModel. I want when users click on any part of the editor (the date, month, or year), it will automatically select them. So I wrote this: But when the first time it clicked, nothing happened. Although when I click it again, it works perfectly. Where’s wrong with my code? Answer From the documentation of MouseAdapter#mousePressed():

Why is the swing gui behaving strange?

I just started making my Java application on Minesweeper. The idea is a GridLayout JPanel inside a JFrame. But after executing the program I get some weird window. There is this strange gray corner on the upper left corner. And the tiles don’t all show. Somehow hovering the mouse over them shows. The program produced this ugly abomination. How to

traverse an array in GUI Java

I am doing a questionnaire with questions and written answers. I need that when adding the answer, press the main button, tell me if it is correct or not and show me the other question of the array, until the array is finished. Here I upload the whole code. Answer You have the right idea, but you need to process

Why is my image not being added? JavaSwing

I made this program, assume I have an extra src folder in my buildpath with the monkiflipppp.gif there. It just runs and has a button, but the button won’t actually do anything… Not sure if I need …

GUI Elements Not Showing Immediately

I made a redesign to my gui in java and it is facing an issue, the icons don’t show until i grab the gui and shake it, sometimes they show half then i have to grab it by the mouse and check it again …

Advertisement