Questions tagged as 'java'

1
answer

How to initialize a blank JPanel?

I'm starting to work with the swing and event handling package and here's what I came up with to test some program that would create rectangles of random sizes and colors. The creation of the code and execution went all out, except that the fram...
asked by 26.06.2017 / 04:34
1
answer

Record audio like whatsapp

Does anyone know how to record an audio while the button is pressed and stop when you release the button like Whatsapp?     
asked by 01.07.2017 / 05:55
1
answer

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start ()' on a null object reference

I'm learning Java and I know basically what NullPointerException means. But I would like to understand why this occurs. This is the Activity code: package com.example.android.miwok; import android.media.MediaPlayer; import android.support....
asked by 22.01.2018 / 07:35
2
answers

How to pass the data from one switch button to another acivity?

I'm developing a mobile application in AS that has a list of cardviews. On these cards I have a switch button that when clicking ON will open an alert dialog to confirm the change of status. But I'm having trouble passing the information, I beli...
asked by 08.01.2018 / 17:13
1
answer

BigDecimal receives the value of a string

I have the following question, how can I sum a BigDecimal with a String . String a = "8"; BigDecimal b = new BigDecimal(2); Would it be something like this? b.add(a); Note: I need the logic to be this, I just need to...
asked by 29.10.2017 / 21:33
1
answer

Verify that all objects in the class that extends RealmObject are empty

My Book.class that extends realmobject public class Book extends RealmObject { private String title; private String author; public String getTitle() { return title; } public void setTitle(String titl...
asked by 15.09.2016 / 16:04
0
answers

Monitor JRE events

How to monitor some jre events like start, close etc? Are there any libraries for this? I need to create a log to store the time that jre is thrown, closed and know who accessed it, all this should be inside a txt file on the local machine, is t...
asked by 17.11.2014 / 14:57
2
answers

Mascara for money on android

I'm creating a function for when the user types in a EditText , it returns me with a chew in the field, Example: Type 1 returns "$ 0.01" Type 11 returns "$ 0.11" and and so on I tried this way public static String addMask(...
asked by 22.02.2018 / 00:39
1
answer

Java wait for the end of the execution of a .bat

I have the following scenario: I have a Java application with Swing; Where by means of a jTextField, I get some information; With this information, I create a .bat This .bat calls an .exe file with the parameters obtained by jTextField...
asked by 16.02.2018 / 14:03
2
answers

Is it possible to generate an executable in Android Studio?

Hello, I want to run my Android application on PC (Windows) without emulator, so it is possible to install with .exe, is it possible?     
asked by 26.11.2018 / 11:43