Questions tagged as 'java'

3
answers

Close connection in another method

I have a class called JavaConnect and I have two methods: ConnectDB and DesconnectDb . Connection class: public class JavaConnect { Connection conn = null; public static Connection ConnectDb(){ try{...
asked by 15.12.2016 / 21:53
1
answer

What does the for and what makes the brackets in an array?

I asked for help in some forums in a game of the old programmed in Java, I understood the logic, but I did not know how to apply it (what commands to use, and how to use it), and I saw the use of Arrays. After seeing a complete code, I understoo...
asked by 03.06.2014 / 04:36
2
answers

Instantiating an Object with a Different Reference

I am learning Polymorphism in Java, but I have some doubts. public class Animal { int numPatas; public void fazerBarulho() { // Código do Método } public void comportamento() { // Código do Método } }...
asked by 20.07.2014 / 21:23
2
answers

Trigger button per shortcut key in Java

I have a java application created by NetBean IDE 8.0. In this application I created a JFrame and put a JButton, which when pressed displays a message. private void btnExibirActionPerformed(java.awt.event.ActionEvent evt) { System.out.printl...
asked by 11.04.2014 / 01:27
2
answers

Problem with very large URL

I'm trying to pass a URL per GET and the server is returning error 404 because the URL is too large (I'm passing an XML through the URL). I have already tried to add the MaxFieldLength variables with 1677721 and MaxRequestBytes with 1677721 i...
asked by 10.10.2014 / 19:59
3
answers

how to call an on-screen image on android

I have a question about displaying an image on the screen in android. example. to call a sound it uses the following code: Button button1; MediaPlyer mp; button1 = (Button)findViewById(R.id.button1); button1.setOnClickListener(new View...
asked by 25.01.2015 / 22:11
3
answers

Call Java application via PHP

I created a Java application here in my company however they want to call this application in Java via a website made in PHP. I would like to know if it is possible for me to make a PHP code that calls a Java application, no matter the form if i...
asked by 09.06.2015 / 15:27
2
answers

How do I return the ID of a record right after it is entered?

I'm doing a Java application in conjunction with a MySQL database and would like to know what would be the best command to return an auto increment ID of the database shortly after the registry was entered. My application will work with multi...
asked by 24.05.2015 / 23:20
3
answers

Sort List in java

I have List<Pessoa> where the attributes of the object are: Name, age, address, etc. I have a Screen where I insert people in this list and generate a report, I would like to display this object sorted by Name. How can I do this?  ...
asked by 15.07.2015 / 18:29
2
answers

Using JSP and JAVA

I'm starting to mess with JSP. But I've been using JAVA for some time. I have the index.jsp file which is my page and I have my indexJava.java which is the program itself. I would like to know how I can unite the two. For example, when I clic...
asked by 26.06.2014 / 17:16