Questions tagged as 'java'

1
answer

Error inserting into the Hibernate database

How do I insert the ProductIngredient object into the database that is composed of an Ingredient object that already exists in the database, without duplicating the Ingredient object in the database. If I remove the cascade and put in the Ingred...
asked by 08.03.2014 / 22:20
2
answers

Maven - Configuring MainClass

Problem: When I create a JAR by eclipse it works quietly, but I'm trying to take advantage of the JAR that Maven is creating and I noticed that it does not execute, because my main class is not in Manife...
asked by 05.03.2014 / 19:26
1
answer

Calculation of the weighted moving average with exponential adjustment

How could I compute a in the following formula in java: Ididthefollowing:Df=Df+a(1-a)xxiGeneralizedformulaIjustdonotknowhowtocalculatea,typemakeaformulawherea=...Thisformulaisknownastheexponentiallyadjustedweightedmovingaverage.Isearc...
asked by 09.05.2017 / 15:59
1
answer

Background in JDesktopPane without losing quality and expandable

I have code to add a background image to a JDesktopPane and it works perfectly on 16:10 widescreen screens. However, when the screen is a bit wider (16: 9), it does not fill the rest of the background. I've seen some other possible ways t...
asked by 16.05.2017 / 14:56
1
answer

How to pass the value of the EditText from a Fragment to the TextView of another Fragment?

I have a fragment containing an EditText in which the user will enter his name. In another fragment is the TextView that will receive the name entered in the previous fragment. Fragment Edit (where the user will type the name): pub...
asked by 14.04.2015 / 20:01
1
answer

How to Distribute RIA with JNLP and Java 8

I developed an application and at the time of distributing with JNLP, I encountered a deadlock. With Java 8, it asks to sign the JARs and the certificate must be from a recognized CA. I signed the JARs with a certificate generated by me (only...
asked by 16.04.2015 / 12:16
1
answer

How to authenticate in site via HttpUrlConnection to get access to JSON method?

I have an Android application that should request a JSON to a web application, however to access the method it is necessary to log in to the site. How do I perform this identification via code? Webservice.java package br.ufscar.dc.contro...
asked by 16.08.2015 / 02:31
1
answer

How to use a custom Adapter in the android ListFragment

Hello everyone, I'm having trouble using a custom Adapter and displaying this Adapter in a ListFragment . My Custom Adapter public class UsuariosAdapter extends BaseAdapter { Context ctx; List < Usuario > usuarios; p...
asked by 29.07.2015 / 16:40
1
answer

How to play a sound using Mediaplayer?

How can I create a button with SoundEffect using the MediaPlayer class or any other android class? I tried using the following code that I found some examples, but I did not succeed. public void playMusic(){ if(player == null){...
asked by 09.11.2015 / 22:45
1
answer

Relate 2 objects to a single reference / key

I have a while(true) that accepts multiple connections ( Socket and ServerSocket ). Each connection is passed to a Handling object that handles its read / write data. This Handling is passed to a Thread so you can accept connections and...
asked by 13.08.2015 / 18:11