Questions tagged as 'java'

1
answer

Collect all the Extras of an Intent

Is there any way to find out what all the Extras in an Intent are! CONTEXT : I have an app that gets url's shared by the other apps: if (Intent.ACTION_SEND.equals(action)) { final String url_ = i.getStringExtra(Intent.EXTRA_TEXT);...
asked by 07.01.2017 / 16:46
1
answer

Call method when the Enter key is pressed

How to call the Send Message method when the Enter key was pressed? Code @Override public void keyPressed(KeyEvent e) { String messageSent = "User: " + writingTextField.getText(); if(e.getKeyCode() == KeyEvent.VK_ENTER){...
asked by 04.11.2015 / 17:23
2
answers

How to play sound in android [duplicate]

Good morning, I would like to know how I can make a code so that when I click on a button it plays a sound     
asked by 23.10.2015 / 17:12
1
answer

Problem with redirect JSF + Primefaces

I have a menu where I have a Registry submenu and inside it a menuItem Usuários in my Template, and I also have a menuItem Sair . The problem is that logging out only works on the Home screen, which is the screen that is c...
asked by 13.07.2015 / 21:19
2
answers

How to force an html document to always be opened by the browser?

I'm developing a java application for a college job and I have a help section for the user where I open a html page in the browser, or at least should open it. The point is that if files with .html extension were by default of t...
asked by 07.07.2015 / 15:18
1
answer

Code snippet in Try

I was making corrections in a class and I came across the following code, did not know it was possible and never stopped to think, but why is this valid? I'm referring to the first line of Try. For me try / catch has always been in the format:...
asked by 30.06.2015 / 19:00
1
answer

JSP for .NET developers

I am a .NET developer who needs to understand a bug that occurs in a JSP application. (I do not need to compile or fix it, just understand how it is using the database and so on.) I already have Eclipse, loaded solution, I have the fonts and...
asked by 28.07.2016 / 23:04
2
answers

Pass value typed to another method

I'm having a question about passing a typed value. I'm posting here because I stayed the whole afternoon yesterday and did not find anything. In 1st class: public class CompararLogin { private String nome; public String cpf; Scanner scan...
asked by 10.06.2015 / 14:21
1
answer

Currency mask for JTextField

I have a JTextField field that should receive a monetary value from the user. I would like to add a mask to this field so that it will format the values entered as follows: 9999.99.     
asked by 19.11.2014 / 19:26
1
answer

Passing data from one txt to another txt

I have a .txt file with three comma-separated names, in this case: test.txt João,Maria,José In my class I get the file and step to a array , separating by comma: String nomeArquivo="teste.txt"; String nomeArquivoGerado=...
asked by 30.10.2014 / 17:19