Questions tagged as 'java'

2
answers

Convert JSON to UTF-8 on Android

I have JSON Array and when it is displayed in ListView on Android, it appears with special characters: JSONgeneratedbyphp:[{"id":"1","titulo":"X-Burg","descricao":"Hambúrguer,...","preco":"R$ 7,50","tipo":"0"},{"id":"2","titulo"...
asked by 03.09.2014 / 14:09
3
answers

Parse JSON Complex

I'm trying to parse a JSON, using GSON, but there is a complex part, because I do not know the name of the keys, so I do not know what names to use in the variables for GSON to parse. I searched and it looks like I have to use Map < & gt ;, b...
asked by 27.08.2014 / 16:58
1
answer

Defining the constructor of an Object

Hello, I'm doing exercises on Java builders but I have a question. I have two classes Main.java public class Main { public static void main(String[] args) { Duck[] d = new Duck[5]; d[0] = new Duck(); d[1]...
asked by 27.07.2014 / 01:28
3
answers

How to read a string using input in Java?

In case I know how to do with int it would look something like: number1 = input.nextInt(); But I want my user to type a string, let's assume a month: mes = input.???? I need to read the string in switch , as in the example...
asked by 23.07.2014 / 00:17
1
answer

How to sort a JSF ui: repeat tag correctly

I have a code but in the view in the view it is leaving unconfigured. <ui:define name="conteudo"> <h:form id="content"> <ui:repeat value="#{mbProduto.resultado}" var="prod"> <...
asked by 28.09.2014 / 19:30
1
answer

How to customize the row of a ListVIew according to the value in the ArrayAdapter

Assuming that I have an object called Item, and that it has text, id, and validation properties, in this case, text is a string, id is an integer, and validation is a Boolean value. class Item { private int id; private String texto;...
asked by 25.09.2014 / 15:03
3
answers

Blank space in Regular Expression

With the following regular expression (^ DOC) * [0-9] I can capture all the numbers after the "DOC" sequence. However, by testing in this text: TEXT TEXT TEXT TEXT DOCUMENT: 240010 9/24/2014 It returns me "24001024092014", the date com...
asked by 26.09.2014 / 16:09
1
answer

Is there a function equivalent to drawPixel in Java?

I wanted to know if there is a function in java that plots a pixel, something like drawPixel or setPixel that I see in some other programming languages, where you inform as parameters the X and Y coordinates and the pixel color to be plotted . I...
asked by 10.03.2015 / 03:10
1
answer

Identify property of an Object in Java + JPA and change it

I am creating a class to get a record of a database and write to another database. I'm using JPA and I ran into a problem. I'm doing a generic insert and I have to wipe the ID of the table to be able to insert, as it arrives a...
asked by 23.01.2015 / 17:58
1
answer

Problem with session in the servet

I have the saida.jsp . It is my page that depending on the option chosen by the user, it is mounted one way. I have two options for user verbs and adverbs . If the user clicks the verbs option it will be redirected to the saida.jsp page...
asked by 20.01.2015 / 20:00