Questions tagged as 'swing'

1
answer

Problems with RowFilter result

I'm working with DocumentListener and RowFilter , and I noticed that my filter is picking up the data I type, and searching by matching all columns in my table. I would like to know, how could I choose the column that it should compare, and a...
asked by 15.03.2017 / 13:58
1
answer

Display dialog box on the foreground screen even if the window is in the background

I'm developing an application where it works with schedules, the user will leave the problem running and will continue to use the pc normally and when you give a certain time will play a sound (already is done) and a dialog box would appear warn...
asked by 11.01.2017 / 14:25
1
answer

How to set the background color in multiple lines of a JTable?

I would like to know how to set the color of the background of multiple rows in the table. In the code below it simply directs the background in just one line, that is, in the last element of the vector. The idea is to pass a list of strings, an...
asked by 18.02.2015 / 17:09
2
answers

Problem with position and size of components

I'm doing a program using the wizard, the famous "click and drag". Most of the project I'm doing on my computer, and I use the command to maximize the screen in the frame, and I set the panels right so that everything fits, but when I continue t...
asked by 28.03.2018 / 00:27
1
answer

Component placement using GridBagLayout

I'm doing a panel and I want to have the following layout: The width of the panel occupies the full width of the frame, and I want to have 4 buttons in the right corner of that panel. I created a panel as container , and within that panel...
asked by 26.04.2014 / 20:31
1
answer

How to display the contents of a .txt file on the screen?

I am using JFrame to try to display the contents of txt files in a window and then delete the whole file. However, when I put it to display, it deletes the file but does not display on the screen that I created with JFrame . What co...
asked by 10.11.2017 / 20:50
2
answers

Implementing JMenuBar in a JFrame

I'm having trouble trying to insert a JMenuBar component into my main frame. I do not get any problems running the code, but the options bar in the program does not appear. What is missing?! Principal.java public class Principal {...
asked by 24.08.2015 / 21:18
1
answer

Stopwatch - Timer

I made a stopwatch (ie a timer) that should be executed when a certain button is clicked. I was able to do the timer, but I can not shut it down. After calling it is timing "forever" rs. I would like you to help me. Code: package controller...
asked by 19.09.2015 / 00:25
1
answer

How can I change the appearance and behavior of the "Open" and "Cancel" buttons in JFileChooser?

Good folks, I'm trying to use JFileChooser to select directories and also files. What I'm using so far is public void buscaFile() { File[] diretorio = null; diretorio = selectDir(); if(diretorio != null) { for(File i : dire...
asked by 18.09.2015 / 01:28
1
answer

how to style the selected JTextPane text?

What I want is to get the selected text from JTextPane and edit it, for example: change font color, size, and family. The problem is that once I change the selected text once, it does not change anymore. My code is that, it's just changing the c...
asked by 17.10.2015 / 08:20