Questions tagged as 'java'

1
answer

Html.fromHtml obsolete for Android N +

In the Android 7.0 (API level 24) static method fromHtml() of the public class Html has become obsolete I do not know why, if they can tell me. Here's an example of how it was used: tv.setText(Html.fromHtml("<h3>Título</h3&...
asked by 28.03.2017 / 06:48
4
answers

Error java.lang.NoClassDefFoundError: org / slf4j / LoggerFactory

Good afternoon! I was trying to run classes from a jar and I came across the following error:    Exception in thread "main" java.lang.NoClassDefFoundError:   org / slf4j / LoggerFactory I researched and found this site: link What exa...
asked by 17.12.2015 / 19:43
3
answers

How to generate random arrays without repeated numbers on the same line?

I want to store random numbers from 1 to 60 in an array. When there are equal numbers in the rows, it is to generate another random number. Type, can not be: 11 55 55 43 49 30, but should be 11 55 52 43 49 30. There should be no repetitions....
asked by 27.08.2015 / 06:35
4
answers

When a String is considered a primitive type in web development?

I was in doubt in a class when the teacher said that a String type was considered primitive! But I've learned in Object Oriented Programming that they're just primitive: Byte: 1 byte. Short: 2 bytes. Int: 4 bytes. Long: 8 bytes. Float:...
asked by 29.08.2015 / 23:21
2
answers

Problems calculating on average in Java

I'm trying to make a program that calculates the average of 4 values. Code: private void botao1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: int n1...
asked by 05.02.2016 / 14:55
2
answers

Generalization of parameters in Java

I'm implementing a B-tree for a Java database job, so that it saves any object types, whether it's generic, so I'm treating it like it's Object , but in some precise code snippets of methods as compareTo() , which should be implement...
asked by 20.02.2016 / 18:07
1
answer

NullPointException when inserting element into list

In the code below is a NullPointException, I tried to fix it without completely changing the code but it did not work, does anyone have a simple solution? I want to add a product in the List<Produto>produtos list there in the Bud...
asked by 08.03.2016 / 18:09
2
answers

Is it possible to store an ArrayList in a Java Database?

Given Banco de Dados using Java , can you store a ArrayList object in Banco de Dados MySql ? If yes, how can I store this type of data? And how can I retrieve it from the database? If possible, could you show a simpl...
asked by 02.03.2016 / 02:44
1
answer

How to centralize the title of a JFrame?

I have a jFrame component and want to centralize the title of it, would it be possible?     
asked by 29.10.2016 / 23:15
2
answers

Apply filters in a JTable

I have a table and in a Jpanel on it I created a textFields and combobox with the intention of using them as a filter. The method: tableRowSorter.setRowFilter(RowFilter.regexFilter("(?i)" + busca)); Does he expect a string as a filter? If t...
asked by 21.11.2016 / 23:18