Questions tagged as 'java'

1
answer

Enum is expanded by the compiler into a class declaration?

Does Enum expand by compiler into a class declaration in Java?     
asked by 08.12.2016 / 14:23
1
answer

Decorating a JTextField with an icon

My question is whether it is possible to "decorate" a field, such as JTextField or JFormattedTextField, with an icon. An example would look something like this: Following an example, I made the following class. package componentes;...
asked by 09.12.2016 / 23:36
2
answers

Regular expression to retrieve strings that begin with a colon (:)

I need a regular expression to retrieve a list of strings that start with the colon (":") and end with the space character or end of parentheses (")"). > Example: String texto = "(:TEXTOQUALQUER NADA DO FOI :TEXTOQQDENOVO SERÁ DE NOVO :TEX...
asked by 11.12.2014 / 20:15
1
answer

What is the difference between using the StandardCopyOption enum constants?

I'm implementing copy of files and decided to use the Files , and one of the method signatures copy() " is to receive 2 parameters of type Path and a third of type CopyOption and it is in this last one that I had dou...
asked by 07.12.2016 / 23:49
3
answers

How to control the volume of the app media on Android

I'm having a question about how to control the media volume of the app. I'm using this method: Button button1; MediaPlyer mp; button1 = (Button)findViewById(R.id.button1); button1.setOnClickListener(new View.OnClickListener() { @Override p...
asked by 01.02.2015 / 12:35
2
answers

Jasper Reports 5 to 6 Methods obsolete

I created some reports through TIBCO Jaspersoft® Studio - Visual Designer for JasperReports and I'm using the lib below in my project. <dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasp...
asked by 16.12.2014 / 13:34
1
answer

How does one method work within another? E.g: service.metodo (arguments) .execute ();

I am not understanding this method within another method does anyone explain me this? Another example of my question: ImageKeywords keywords = service.getImageKeywords(image, forceShowAll, knowledgeGraph).execute(); It has a method that...
asked by 27.06.2016 / 16:26
1
answer

What is the constant pool in Java?

I'm reading the Java Virtual Machine Specification to dig a little deeper and I did not quite understand what the constant pool table is. For example, when speaking of the run-time constant pool the specification quotes this table:    A run-t...
asked by 29.07.2016 / 17:10
1
answer

How to limit and display the number of characters in a JTextArea

I have a supplier registration window, and I would like to enter a jTextArea so that the user has the option to enter any comments about the supplier. The idea is to limit the number of characters to be typed and show the amount...
asked by 14.07.2016 / 20:15
2
answers

Questions related to recursion

Good afternoon. I'm developing recursive methods that work on a binary search tree, but I'm having a hard time recursion. For example, the method below should return the height of the tree: public int altura(){ return altura(root,0);...
asked by 18.11.2015 / 22:38