Questions tagged as 'swing'

0
answers

JScrollPane producing glitches on the screen

I have little experience with Java Swing and am catching up with a simple thing. The code below produces glitches on the screen when the scroll bar is dragged repeatedly and I do not know why (maximize the screen first to see better and drag...
asked by 22.11.2018 / 12:39
0
answers

Draw a JPanel inside a JFrame [duplicate]

I would like to know how to draw a line inside a JPanel that is within a JFrame , at the push of a button. The layout of the button and JPanel within JFrame is exemplified in the image below: Whenthebuttonispress...
asked by 12.06.2018 / 22:51
1
answer

Glitch with JPopupMenu in Java Swing

I created a small application to test a JPopupMenu along with a JTextField, the problem I encountered is that when I click very fast, repeatedly following together selecting the items one time or another from a glitch / bug on the screen, it lea...
asked by 12.01.2018 / 20:38
1
answer

Screen stops responding after clicking one of the buttons

I'm doing a simple game show of the old woman next to Swing. I wanted to know why, when I trigger an event to click through the ActionPerfomed method, my program freezes. I've been researching a bit and found that these are normal interfa...
asked by 29.11.2017 / 22:34
2
answers

Trigger button per shortcut key in Java

I have a java application created by NetBean IDE 8.0. In this application I created a JFrame and put a JButton, which when pressed displays a message. private void btnExibirActionPerformed(java.awt.event.ActionEvent evt) { System.out.printl...
asked by 11.04.2014 / 01:27
1
answer

Create button with java icon?

I'm having trouble creating a button with an icon in java, I've looked at several tutorials, but I can not get it to work. Note: I am using eclipse, Windows 10. The folder that is in the image is src where the Main class file is. import...
asked by 18.05.2017 / 21:17
0
answers

Java swing - exercise [closed]

I'm doubtful about Container, I'd like to know if the way I've done is correct. public class Exercicio2 { public static void main(String[] args) { JLabel lblTitulo = new JLabel(); JLabel lblLogin = new JLabel(); JLabel lblPasswor...
asked by 06.06.2017 / 17:05
1
answer

Background in JDesktopPane without losing quality and expandable

I have code to add a background image to a JDesktopPane and it works perfectly on 16:10 widescreen screens. However, when the screen is a bit wider (16: 9), it does not fill the rest of the background. I've seen some other possible ways t...
asked by 16.05.2017 / 14:56
1
answer

Do Multiply 2 Fields in JTable

I'm trying to get a multiplication of 2 fields in JTable but I can not do SpecificallytheFieldQuantityandUnitValuetomultiplyandgivetheTotalValueJTableScreenpackageTelas;importClasses.Cliente;importClasses.Material;importClasses.Orcamento;imp...
asked by 23.02.2017 / 23:49
1
answer

How to pass more than one parameter in a paint () method in Java?

I was developing a project where I need to override the paint () method, but the paint () method only receives a Graphics object as a parameter. What I need to do is create a paint method that takes two parameters and uses Image objects belongin...
asked by 07.12.2016 / 18:53