Questions tagged as 'java'

1
answer

Array and the type being created

In Java, when I have the following statement: int[] ns = new int[5]; the following doubts arise: Is an object created of what type? For each value in an index, do I call it an instance?
asked by 03.02.2018 / 18:52
1
answer

How to get the number of rows from a StringList and apply?

I have a StringList inside a mensagens.txt file, I would like to count how many rows have this StringList contained within that file. For each line of the string 1 code will be run in plugin code. If StringList...
asked by 08.02.2018 / 04:27
1
answer

What is the advantage of using BufferedImage for images?

I want to know the difference in using BufferedImage and the graphics method to draw the images to ImageIcon . Here is an example: @Override public void paint(Graphics g) { g.drawImage(bfImage, 0, 0, this);...
asked by 14.01.2017 / 21:54
1
answer

Pass the execution of a given method to the SwingWorker as an argument

I have a small application in swing , where I would like to display a progress when certain actions are executed As an example, I have the listener below that is executed when a JComboBox is changed. It takes the selected...
asked by 28.03.2016 / 15:36
1
answer

Java Table Table Test

I'm having difficulty solving the table test of the following code, could someone show me the output and how do I do it? public class Principal { public static void main(String args[]) { int array[] = {1, 2, 3, 4, 5}; int a...
asked by 24.03.2016 / 22:47
1
answer

Thread from a flashing point

Hello, I made a program that you move a ball with the arrow keys that only flashes the screen when it moves. I've seen other programs in this kind of mine that just do not blink. If anyone can help me... (the background stays normal but the ball...
asked by 22.03.2016 / 02:16
1
answer

Formatting values in the house of millions

I want to format values in the millions. Example: The result of a calculation would be 1.960,35 . But the output is 19603565.2315789 . I was using DecimalFormat , but it was for smaller numbers. How to do this in the hous...
asked by 26.03.2016 / 02:15
2
answers

Returns the database's data in a JTextField

I'm having a question about listing the data I've written to a database with JTextField . I created a screen, with the field for the user to enter the cadastre ID in the bank and a FILTER button. I want, when I click on Filter, the data fo...
asked by 31.03.2016 / 18:07
1
answer

How to change the name in the upper bar dynamically when a fragment is selected?

I want the name in the upper bar to change according to the fragment that is selected, for example, I chose the list of clients list, then on the bar it would appear "List Clients", but I can not do it, it only gets the initial name. Here is the...
asked by 24.03.2016 / 05:12
1
answer

Create class inheritance

I'm studying object-oriented Java programming and need to do the following exercise: Implement class Funcionario and class Gerente . Create the class Assistente , which is also a Funcionario , and which has a numb...
asked by 20.03.2016 / 16:49