Questions tagged as 'java'

2
answers

How to call a sound when you click the android button [duplicate]

Hello, I would like to know how to call a more efficient sound? I'm using this method: Button button1; MediaPlyer mp; button1 = (Button)findViewById(R.id.button1); button1.setOnClickListener(new View.OnClickListener() { @Override public voi...
asked by 29.01.2015 / 18:27
1
answer

How to set a Spinner value on an object

I have the following table: <p:dataTable id="tabelaDisciplinasSelelecionadas" var="disciplina" value="#{disciplinaBean.droppedDisciplinas}" rendered="#{not empty disciplinaBean.droppedDisciplinas}">...
asked by 29.01.2015 / 05:43
1
answer

Autocomplete in a jTextfield - adapt class

I was able to find here a code to autocomplete a jTextfield. As I am new to programming, I have already tried to adapt this code to use in JTextfields of other classes that I have but have not yet achieved. I tried to put this part of the c...
asked by 10.11.2014 / 13:32
1
answer

Doubts in using the dataExporter

I am using the dataExporter from primeFaces to export the contents of a dataTable into pdf. The problem is that the pdf does not bring the name of the columns, just the content. In the examples I've seen in the showcase, it captures the column n...
asked by 10.11.2014 / 20:39
1
answer

How to maintain screen orientation?

I would like to know the equivalent Java code for this command: android:configChanges="orientation" Justification: I'm creating an app with the NavigationDrawer Layout, and I need to make certain settings (or all screens) when the us...
asked by 02.12.2014 / 12:56
1
answer

How to have only one adapter for multiple Activity?

I would like to know if in some way it is recommended to have an adapter for each Activity . I know what to do with an Adapter for every Activity is quiet. Now how to make a generic Adapter , would it? Would you be following the...
asked by 02.12.2014 / 00:11
1
answer

I can not delete the input of a JFormattedTextField

I'm doing a program and it uses some formatted JTextFields, that is, JFormatedTextField that calls a MaskFormatter. The problem is that when writing a message and trying to delete it, the message comes back, making it impossible to leave the fie...
asked by 02.12.2014 / 21:38
1
answer

Group TextViews and then access them

Example: I have 3 TextViews and its id's : TextView tv1 -> id: "um" TextView tv2 -> id: "dois" TextView tv3 -> id: "tres" I would like to group them in some way that can access them through the group, eg: ViewGrou...
asked by 13.01.2015 / 00:08
1
answer

Exception being thrown when using the Commons-email API

I'm trying to use the Commons-Email API as an alternative to known JavaMail to send emails in Java but there is a problem. The following Exception is being released:    Exception in thread "main" java.lang.NoClassDefFoundError...
asked by 06.11.2014 / 16:25
1
answer

Toggle action of a button

I've been researching the internet and found nothing that can explain me how I do to toggle the action of a button in Java ... Example: I have a button that when I tighten it I want it to change the texts of 2 labels, and when I press it aga...
asked by 17.03.2015 / 18:44