Questions tagged as 'java'

1
answer

Comparing String Strings in Java [Duplicated]

Question from an ignoramus, in java, why does not this work? nombre = S.nextLine(); nombre= nombre.toLowerCase(); if(nombre.equals("juan") || nombre.equals("pedro")) { ... } I take it as always different, like the String can not be compar...
asked by 15.08.2017 / 01:50
1
answer

You doubt with a PreparedStatement that executes an UPDATE

I have this PreparedStatement , I would like to know if it is correct, I would also like to know if you have to create a method to do EXECUTE , or in the same method of PreparedStatement of UPDATE . public void Modify(...
asked by 15.08.2017 / 20:33
1
answer

Help with vectors and prime numbers

Leer 10 enteros , store them in an array and determine in what position of the array the highest prime number read is. int vector[] = new int[10]; //Declaro, instancio vector int enteros = 0; // Variables a utilizar...
asked by 13.08.2017 / 22:03
2
answers

Print cycle while in a TextArea that is in another Java class

I have this program that pings a specified host. public class PingTool { private String ip = ""; private int port; private int times; private String hostaddr = ""; String resultado; public void setDireccion(String ip, int port, int times){...
asked by 14.08.2017 / 03:03
1
answer

Add an image in a JPanel in the same class

hello the following is my code, but although it does not show me error and compiles, it simply does not work, I do not know if I made an error or if I put the image wrong from the beginning, because the image I have it from the download folder ....
asked by 08.08.2017 / 22:14
1
answer

Variable type changes (Java)

Good morning. I work with NetBeans and Java 8. I have a little problem with regard to java variables, more specifically when it comes to changing type. For example, when I define an int and I want to change it to double , it does not work eve...
asked by 09.08.2017 / 09:15
1
answer

Failed to import bean definitions from URL location

I'm creating a project with spring-mvc and MongoDB, when I start the Tomcat server from Eclipse it gives me the following error:    org.springframework.beans.factory.parsing.BeanDefinitionParsingException:   Configuration problem: Failed to i...
asked by 08.08.2017 / 14:49
2
answers

Syntax error, insert "}" to complete ClassBody [closed]

The last sign (which is this}) makes me put another package com.gmail.christiangoac77; import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.ev...
asked by 08.08.2017 / 11:45
2
answers

insert image in SQL field IMAGE with Java

I want to save my image in a database in SQL in a field called fotoEmpleado of type IMAGE , until then everything is fine, because I am saved in BYTES The problem is when reading it, I want to show it in a Label on my form, I underst...
asked by 09.08.2017 / 05:10
1
answer

Capture argument error

I have the following program: public static void veureinfo(String filePath) throws FileNotFoundException{ File origen = new File(filePath); if (origen.isFile()){ System.out.println("Java VeureInfo " +origen.getAbsolutePat...
asked by 21.09.2017 / 15:56