Questions tagged as 'java'

1
answer

Cast from the name (String) of the object type

I get a list that has several types of HTMLElements. I need a NameValuePair list, with name and value of each object. So I have this function that gets the list: private List getValoresPost(List parametros){ List<NameValuePair> p...
asked by 12.12.2017 / 15:43
1
answer

Error in SQL Server connection with Java in Resteasy API

I'm using the Microsoft 6.0 JDBC driver in a one-time project API using Java (JRE 1.8) with resteasy using Eclipse Oxygen and Tomcat 7 (I tried with other versions and presented the same behavior). My connection code is as follows: public cl...
asked by 11.12.2017 / 14:57
1
answer

How to detect if the JSpinner value has changed?

I want to perform an action whenever the value of JSpinner is changed. How do I do this?     
asked by 23.01.2018 / 02:36
1
answer

java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2

I have an error to save the validity of my package, I am passing the position of the array. What could be wrong? int position = 0; for (Pacote pacote: pacoteList) { Vigencia vigencia = new Vigencia(); if (pacote.getVigencias().si...
asked by 08.12.2017 / 13:11
1
answer

Application with slow vraptor after updating java and tomcat

I'm working on a legacy application and the application to the natural is already a little slow, I believe the way it was developed, but after upgrading the version of java 7 to java 8 and tomcat 7 to tomcat 8 the application takes almost 2 minu...
asked by 13.11.2017 / 15:52
1
answer

Convert ImageIcon to Image or ImageIcon to BufferedImage

I'm having trouble finding ways to convert ImageIcon to Image or if possible ImageIcon to BufferedImage in order to save it to the database. I gave some searches on the internet but the information found is a bit conf...
asked by 27.11.2017 / 05:18
1
answer

eclipse - java - errors

Can someone help me to find the error of this code package trab; import java.util.Arrays; import java.util.Calendar; import java.util.Scanner; import java.util.TimeZone; public class tra { public static void main(String[] args) {...
asked by 22.11.2017 / 00:46
1
answer

Magic Cast - Convert String to various object types

Class: @Entity public class ReportParam extends AbstractModel implements JRParameter { @Column private String nome; @Column private String descricao; @Column private Class<?> classe; The goal: Use the instantiated attribute repo...
asked by 26.01.2018 / 17:05
1
answer

Define text to JLabels dynamically according to validation of text fields

I tried to add a label to each mandatory component of my screen that is empty (field 01 and field 02), so I created a list of labels with the corresponding amount of fields / components. However, the attempts I made to "set" the co...
asked by 04.12.2017 / 20:59
1
answer

ERROR: this - can not be applied to

error appears in part of code where I have "this" private void sendEmail() { //Getting content for email String email = editTextEmail.getText().toString().trim(); String subject = editTextSubject.getText().toString().trim(); St...
asked by 06.11.2017 / 12:04