Questions tagged as 'java'

2
answers

Scale a value in a given range

My programming teacher asked this question and I could not understand why I have to use one of these formulas to scale the temperature. And I also could not identify what the correct answer would be. You have the variable temperature, which rang...
asked by 26.10.2017 / 02:55
1
answer

Java and JSON API

I would like to know if anyone knows a good API and with tutorials to create, edit, write and read JSON files in Java. I've been searching for some time and so far I have not found it.     
asked by 23.11.2017 / 00:24
1
answer

Error: Could not find or load main class OlaWorld.java [duplicate]

I'm trying to compile and run a "hello world" in Java from the command line. My code is: public class OlaMundo{ public static void main(String[] args){ System.out.println("Oi , funcionou"); } } I'm trying to run through the com...
asked by 13.07.2018 / 14:02
2
answers

Convert JTextField to integer and save to bd

I have a JTextField that is populated from the database as text, I would like to save in another DB as int . Could someone please help me? My code: String sql = "INSERT INTO ass_cidade(id_cidade) VALUES(?)"; try { pst = Co...
asked by 23.12.2014 / 13:15
1
answer

Problems creating jar executable with JLayer library in Intellij [closed]

Good afternoon, guys. Here's my question: I'm creating a simple desktop application in Java 8 with swing in Intellij. At the end of some modifications I created an .jar executable and by that point everything was fine. As of today I'm us...
asked by 18.12.2018 / 20:53
1
answer

Failed to add Class objects to the Array List

I have the class below: package carcleo.com.radiosingular.classes; import android.util.Log; import android.widget.Toast; import com.google.gson.JsonArray; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject;...
asked by 20.12.2018 / 13:01
1
answer

Scroll between two dates

I have two dates in milliseconds. I need to recover each day of that period to make an insert in the database. I thought about making a for every day of this period, but I have no idea how to do it!     
asked by 08.01.2018 / 21:41
2
answers

List of files in a folder [closed]

Hello I'm using JFileChooser to get files on the system. But now I need to use JFileChooser to select folders and add all of their content to the program. I used DIRECTORIES_ONLY and it worked. Now I want to add all the files (using a...
asked by 24.11.2016 / 20:56
1
answer

I can not do a unit test

I have a problem with doing a test method in this JAVA program. The method I created was to check if the wolf is dead. @Test public void verificaSeOLoboMorreAposCompletarAIdade(){ campo = new Campo(4,4); localizacao = new Localizacao(0...
asked by 24.08.2017 / 21:19
1
answer

Error: Exception in thread "main" - StackOverflowError

I created a CRUD from a library, but when I instantiated the class Biblioteca in main , and I went to execute that giant error occurred: ClassCadastrar:packageOperacoes;importjava.util.InputMismatchException;importjava.util.Scan...
asked by 01.07.2017 / 02:29