Questions tagged as 'java'

1
answer

How to insert data (cadastre) in SQLite?

Hello, my connection to SQLite is as follows: Connection connection = null; try { // create a database connection connection = DriverManager.getConnection("jdbc:sqlite:database.db"); S...
asked by 30.05.2018 / 05:36
1
answer

How to pass an AngularJS value to the JAVA controller

I have a form that sends a value (CPF) of a page to be checked for existence in the database. I use an angular controller to send the cpf to service and then to the controller. Would you have any examples of how to do this? HTMLCode      ...
asked by 15.02.2017 / 01:48
1
answer

What is the error in the program? [closed]

Give me an error where R appears in red. public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R....
asked by 22.06.2017 / 18:37
1
answer

Robot Class with Variable

I have a code and I need to write the value of a variable through the robot class, for example: int camera=2 Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_C); robot.keyPress(KeyEvent.VK_A); robot.keyPress(KeyEvent.VK_M); robot.keyPress...
asked by 28.06.2017 / 13:42
1
answer

How to implement the onBackPressed () method in a class that inherits from Fragment, causing it to go back to the previous Fragment?

Segue um trecho de código para exemplificar meu problema: public class DashboardFragment extends Fragment{ ... } @Override public void onBackPressed(){ //Aqui volta para o Fragment anterior... } It gives the following error: Erro...
asked by 07.02.2017 / 21:14
2
answers

Java - method to check if a String contains a given character

I have a problem with this method. It seems to me that whenever I try to use it with some String, I get false for the value of a, even though the String contains those three characters. Can anyone tell me what's wrong here? public stat...
asked by 23.08.2017 / 20:59
1
answer

UnsupportedClassVersionError when trying to generate a jar

I have compiled my code and everything else and when I open the file .jar created it says A JNI error has occured cmd: C:\Projetos\Java\Projetos\Projeto02>java -jar Gerar.jar Error: A JNI error has occurred, please check your in...
asked by 23.10.2017 / 01:14
1
answer

Error javax.el.PropertyNotFoundException: Array index out of range: 0 Java JSF intersection exercise

I'm new to programming and new to the Forum. I have a college exercise that I am not able to do, I need to create a screen called Intersection, which receives 2 intervals and returns a message on the screen informing if there is an intersection...
asked by 22.10.2018 / 20:12
2
answers

Java Language - Undo and Redo Functions

I'm doing a project where I develop functions to apply effects to photos (like Contrast, Vignette, Sepia ...). As I apply effects to photos, the various states of photos are stored in an image vector. In this same project, I need two funct...
asked by 14.12.2017 / 19:53
1
answer

JDBC CallableStatement: Application hangs when calling procedure [closed]

When I run a procedure on the application, it crashes, but on the database it executes normal. This is the way I use to call procedure : public int incluir(TOCompra compra) { try { PreparedStatement ps = BancoDados.getConexao...
asked by 24.10.2015 / 00:39