Questions tagged as 'java'

1
answer

Method resolution

in the example below public static void foo(Integer i) { System.out.println("foo(Integer)"); } public static void foo(short i) { System.out.println("foo(short)"); } public static void foo(long i) { System.out.println("foo(long)")...
asked by 20.08.2014 / 13:19
1
answer

How do I call Arrays.sort (array, new methodOrd ()) in Java?

Knowing that I have a class with an array of objects and another class that implements the interface Comparator . I would like any example just to learn and be able to sort an array of objects by their name in my class that implements...
asked by 17.09.2014 / 16:26
2
answers

Customizing JTextFields

Many professional programs use JTextFields or JButtons with different borders. Would anyone have code examples to change the design of these buttons and text fields to something like the following image? I believe it's with an @Over...
asked by 11.07.2014 / 01:48
1
answer

Run another application as soon as it receives an SMS

I need to call an application already installed on my phone once I receive an SMS from a certain number. All the code in this application is ready, but I do not know how to call it from that message. Should I use Intent or something...
asked by 19.05.2014 / 18:05
1
answer

How to Run JavaScript on the Java 8 Nashorn Engine Programmatically

From Java 8 we have a new Engine for running JavaScript, this is Nashorn. What Java SE platform classes are involved in engine discovery and scripting? How to execute JavaScript through the Java classes themselves in this new interpreter?...
asked by 26.06.2015 / 16:16
2
answers

Transform Byte into String

Problem: I am getting byte and when I try to transform to String it is giving error. ... byte[] msgBytes = ch.decode(hex, ch.key()); // retorna byte String msgDecode = msgBytes.toString(); // tentando converter byte em Stri...
asked by 27.02.2014 / 20:15
1
answer

Relation of Java types or another language with processor architecture

In Java you have the primitive types: int and float , which hold a maximum of 32 bits of information, and also have long and double types that hold 64 bits of information. Does this have or could have anything to do...
asked by 01.09.2017 / 16:11
1
answer

how to center the TabbedPane tabs?

I've been researching, but I have not found it. I would like to know how to center tabs on a TabbedPane. They always start from the left, but since they are just two tabs, you want them to be centered. Illustrative example: Simpleexample:...
asked by 03.12.2016 / 19:40
2
answers

Time Mask or TimePicker JavaFX

I have TextField where I enter the time, however I always have to type : . How can I put a mask in this TextField or if it is simpler a TimePicker ?     
asked by 29.07.2015 / 14:14
1
answer

What secure way to check if an object is numeric?

I am implementing some generic functions in a module of my system, and I want to treat in a certain situation if the registry is numeric (I make calculations). Then searching some way to do without having to compare with each numeric type sep...
asked by 31.07.2015 / 15:19