Questions tagged as 'java'

2
answers

Read file and save lines

I want to read a txt file by writing each line of the file into String variables, (which I use to save some data, from a basic program I'm doing) I thought of something like this try { FileReader fr = new FileReader("C:\Users\lucas...
asked by 20.11.2016 / 18:29
4
answers

How to create a regex to filter and delete files with a certain length in the name

I'm trying to figure out a way to delete files that windows duplicates when making multiple copies. I was able to do something by creating the code below: import java.util.*; import java.io.*; public class FileCreator{ public static voi...
asked by 25.11.2016 / 22:57
1
answer

Why is this method not adding up?

I'm trying to add two numbers by Swing and JOptionPane , but the below error is appearing. Someone to help me how to solve this? Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: JOptionPane: parentComponent d...
asked by 31.01.2017 / 15:09
1
answer

Use the same jFormattedTextField for CPF and CNPJ mask

I would like to know if it is possible in a same JFormattedTextField , toggle mask for CPF and CNPJ. When I use the mask of JFormattedTextField the value is already static, and if you put it to the CPF, it will not fit the CNPJ a...
asked by 15.07.2016 / 15:26
2
answers

How to implement classes with private method?

I am rewriting the code of an application looking for the best use of the interfaces and I came across a problem: I have a class that needs to have a private method and I want to create an interface for it, since I have other classes that do...
asked by 13.07.2016 / 16:09
2
answers

Generation Strategy Id Hibernate in PostgreSQL

I have a system in JEE7 with Hibernate and PostgreSQL database, the tables are with auto Id generation by Hibernate: @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; What happens is that Hibernate generates a unique index...
asked by 18.05.2016 / 06:00
1
answer

How to change the encode in Java?

I am consuming the IBGE API to get municipalities by state. When I print out the municipalities the accents are wrong. What can I do to fix this? Below the code that takes the name of the municipalities. JSONArray jsonarray = new JSONArray(jso...
asked by 06.11.2018 / 13:12
3
answers

Form waiting for a request

Problem My form makes a requisição determine a database (select, insert, update, delete values), however whenever these requests are made a crash occurs on the form (a freeze)! How do I prevent forms from receiving these crashes rega...
asked by 25.02.2014 / 19:47
4
answers

Problems installing Android Studio on Linux Fedora

A few days ago I tried to install the Android Studio editor on Fedora linux and I can not. I searched in some tutorials, sites, google and could not find a solution to deal with the error below:    ERROR: Can not start Android Studio \ nNo...
asked by 20.02.2014 / 22:05
1
answer

Fill Array args parameters without leaving Eclipse

I have parameters that are passed when executing the .jar of my code, in args , as in this example: public static void main(String[] args) { final File diretorio = new File(args[0]); final String extencao = "." + args[1];...
asked by 28.11.2018 / 23:51