Questions tagged as 'java'

1
answer

Error making Jar Build

I'm trying to build my first JAR using IntelliJ and Maven to manage the dependencies. I created the artifact and executed build , but when I run the program I get the following exception : Exception in thread "main" java.lang.Securi...
asked by 17.04.2014 / 19:48
1
answer

Daily notifications at a specific time set by the user

I've created a method to send a notification to the user with the name sendNotification() using NotificationCompat.Builder and NotificationManager . I need this notification to be launched every day at 07:30 AM , and th...
asked by 10.03.2017 / 18:16
1
answer

How to make the arrow turn several times until it stops by itself after clicking the button?

In the question " How do I rotate an arrow within a circle using Java2D? , I was able to learn how to do the arrow rotates within the circle. But I need to make the arrow spin like a casino roulette, until I stop by myself. I thought about us...
asked by 11.10.2017 / 03:28
1
answer

How to define the order in which the components will receive focus through the TAB?

To organize the focus order of the components up to version 1.4 of java, we used the setNextFocusableComponent() ". However, it was discontinued as of the cited version. I would like to know how I can do this in the latest versions so...
asked by 11.09.2017 / 14:00
3
answers

Change CRT file to byte

I need to convert a file .crt to byte so I can send it by socket. This code works in Java, but how would I write it on Android? Path path = Paths.get("sdcard/certificado.crt"); byte[] certificado = Files.readAllBytes(path);     
asked by 16.03.2014 / 13:06
1
answer

When to use Supertype or Subtype on return method?

Suppose I have a method called " meuMetodo() " that returns an Object of type ArrayList<String> , I can make this method declare that it returns more concrete or more abstract types:    public ArrayList<String> meu...
asked by 10.05.2017 / 22:08
2
answers

Is it possible to change the value of a note at run time?

Considering the following annotation: @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface MinhaAnotacao { String valor(); } Defined in a class: @MinhaAnotacao(valor = "algum valor") class ExemploStackOverflo...
asked by 26.05.2016 / 04:23
1
answer

Multi Tenancy with Hibernate update schema

Hello, I'm using an application that uses multiple (multi-tenancy) databases using hibernate. I would like to know if anyone knows any way Hibernate can do the update in the schema of the banks. I have already set the hibernate.hbm2dll.auto: upd...
asked by 05.07.2016 / 22:38
1
answer

Java - Send Email Securely via the Gmail API

I'm using a API mail%% of this tutorial for sending email via Mail.jar , however I realized that I have to, enable permission for less secure applications. Is there another way to send email Java , without having to enable this les...
asked by 03.11.2016 / 22:22
1
answer

How to restrict so that a larger date and then a shorter date are not used using Calendar Restrict?

Good evening! Here is my problem: I'm making a screen that has two calendars: Theprogramwillreturnmealistcomprisingtheintervalbetweentwodates.Onedateisfromthefirstcalendar,andtheotherfromthesecondcalendar.However,mycodebelowisnotworking.&...
asked by 28.05.2016 / 00:00