Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
1
votes0
answers67
viewsDevelopment of a Distributed Alarm System
My teacher went through some work to develop a panic button alarm tool, sort of. Where a computer (client) will trigger the button and another computer (server) will receive the notification and…
-
1
votes1
answer577
viewsHow to find the value of a hashmap element?
I have a very strange doubt, I have a HashMap that has these two values ids("pergunta","IdP"); To pergunta is a String and IdP is a Int, me now to get the value of Idp I have to do int a =…
-
1
votes1
answer279
viewsHow to run a command on Android when touching the screen or swiping your finger on the screen?
How to run a command on Android by touching the screen or swiping your finger on the screen, if someone can help me
-
1
votes2
answers297
viewsUse the return hardware button to another function
I have an app with several Activitys, whenever I change Activity I run the following commands: Intent intent = new Intent(gerenciar2.this, excluir.class); intent.putExtra("tabbanco", tabbanco);…
-
1
votes1
answer66
viewsError in Namedquery
Good evening guys, I’m looking to create a namedquery with a bank appointment. Follows: @NamedQuery(name="ListagemProdutosMesa",query="select Produto p FROM Produto p, Pedido pe, Conta c,…
-
1
votes1
answer47
viewsRuntimeexception (Android)
I want to put the atendenteBalaoProdutoNome on the side of AtendenteBalaoProdutoValor, thus: to do this, I tried this: attendant.xml <?xml version="1.0" encoding="utf-8"?> <merge…
-
1
votes1
answer253
viewsAutocomplete in jTextfield - adapt class
I was able to find here a code for autocomplete in a jTextfield. As I am new to programming, I have tried to adapt this code to use in Jtextfields of other classes I have but I haven’t been able to.…
-
1
votes1
answer461
viewsPick up various values and play within a variable
I needed to get all the answers inside Boolean respostas1 and play inside another variable so I can send it to the Mysql database. The way I did, he’s returning me all false. For example, I have 4…
-
1
votes1
answer80
viewsDoubt regarding the function is
for(int i=0; i<mat.length; i++){ for(int j=0; j<matrizFemininaArryn.length; j++){ if(mat[i][5].equals("Feminino") && mat[i][4].equals("Arryn")) matrizFemininaArryn[j] = mat[i][0]; } }…
-
1
votes1
answer2086
viewsJava program only works on the development machine
I created a Java application in Netbeans. This application has a GUI and uses some external Jars. After doing Clean and Build in the Netbeans dist folder a Jar (main class) and a folder named lib…
-
1
votes1
answer205
viewsTransform javax.persistence.Query to Arraylist
It is possible to transform a javax.persistence.Query in ArrayList. I need to return an object of the type Query but it cannot have all the values of the result. I want to eliminate some results…
-
1
votes0
answers155
viewsWhat is object-oriented programming?
I know that C++ and Java are examples of object-oriented languages. I know that the Std::Cout << "string"; is an object, but I don’t know what object-oriented programming is. What?
-
1
votes2
answers53
viewsLock btprevious2.setOnTouchListener function
I have an application where I use the method btprevious2.setOnTouchListener to make the page change quickly. btprevious2.setOnTouchListener(new View.OnTouchListener() { private Handler handler;…
-
1
votes1
answer3080
viewsHow to use for each in array of arrays(array)?
Having the array of arrays: int matriz[][] = new int[1][1] How do I use for each (for(int Count : array)) to traverse your rows and columns?
-
1
votes1
answer500
viewsAdapt Tooltip code to an already created jTextField
I found this code that works well for the button: public class CustomJToolTipTest { private JFrame frame; public CustomJToolTipTest() { initComponents(); } public static void main(String[] args) {…
-
1
votes2
answers543
viewsJava error SQL query
I am trying to make a webapp in java , however I am beginner , in the login part of the app, I created a routine that receives as parameter an object and performs a search in the database according…
-
1
votes1
answer772
viewsMy app in android studio is closing, while consuming webservice
I have a problem in my application, when consuming a web service, the application is closing. The idea of my application is I consume this web service to validate my login, and returning a message…
-
1
votes1
answer380
viewsError while consuming webservice Soap on android
I have a web service whose wsdl is this: which rotor the next one runs in the browser: <!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.2.0-1 (tags/2.2.0u1-7139;…
-
1
votes1
answer3184
viewsHow do I adjust my app to the screen size of multiple devices?
Good afternoon, I am developing an application in Android Studio and it is well adjusted in my Motorola Moto X 2nd Generation. However, in my Samsung Galaxy Note 3, Motorola Moto E and Motorola Moto…
-
1
votes1
answer212
viewsA little problem in Eclipse
There was, yesterday, asked a question right here on the website regarding a problem in my Eclipse ADT. I heartily thank the lucky, whose name I don’t remember, for helping me! The way was to…
-
1
votes2
answers794
views -
1
votes2
answers81
viewsIs it possible to make two Selects in a Try?
try { Connection lig = DriverManager.getConnection("jdbc:mysql://localhost/gym", "root", "0000"); PreparedStatement inst = lig.prepareStatement("SELECT * FROM produtos_has_historico WHERE…
-
1
votes0
answers959
viewsRooster Game / Old Game with Application Level Protocol
General Information I’m using the Notepad++. I intend to have the program of Tic-tac-toe fully operational. Replicating the problem First execution Tictactoeserverprotocol this way using a plugin:…
-
1
votes1
answer89
viewsRequest and Response in JSTL, when to use?
I’m wrong to say that request I will redeem what I sent for an "action"? And response? I read in several places about and did not understand very well, it was not clear to me... Someone can…
javaasked 9 years, 6 months ago Diego Moreira 684 -
1
votes1
answer649
viewsHow to call a class from an event?
I have a main class, through it I call a layout with listview, and depending on the click, opens a different screen with different customer data. Follow a piece of code: public OnItemClickListener…
-
1
votes1
answer331
viewsInsert component without using setBounds
I’m using a free design in my project and dragging to my jFrame the components I want. However, I needed to use a jComboBox with autocomplete and guided by this site. Now I wanted to use the class…
-
1
votes0
answers159
views"java.sql.Sqlexception: Incorrect string value: xE7 xF5 for column" error
Good afternoon, I’m having the error below whenever I try to run an indexing method. ERROR: javax.servlet.ServletException: net.alforria.util.InfraException:…
-
1
votes1
answer106
viewsProblems in JSP implementation using Struts2
After executing the following jsp: <%@ taglib prefix="s" uri="/struts-tags"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ page language="java"…
-
1
votes1
answer1470
viewsReporting Error Jasperreport + Netbeans net.sf.jasperreports.engine.Jrexception: java.net.Malformedurlexception
Good morning, I’m trying to generate a report just doing the design in ireport, then put the . jrxml in netbeans and I try to compile there, then when it comes time to get the report path it…
-
1
votes1
answer1996
viewsHow to update a jTable that displays BD data after registering a new item?
I have a table (jTable) that displays all the data registered in a database. My table is filled every time the application is started through a Windowevent, but when I make a new registration in the…
-
1
votes2
answers271
viewsHow to render a String that is in this format yyyy-mm-dd HH:mm:ss.fff presentable
I have a date that is a return from the database that comes in this format yyyy-mm-dd HH:mm:ss.fff, how can I turn this into dd-mm-yyyy HH:mm Example: My date is like this: 2015-01-16 07:49:45.0 and…
-
1
votes2
answers1930
viewsHow to open pdf on Android?
In my application there is a button where when clicked, will open a arquivopdf, but could not get this file from the internet, would have to come along with the application, I am using the following…
-
1
votes1
answer1026
viewsInput Date causes error 400 - The request sent by the client was syntactically incorrect
Every time I insert one input of the kind date in my form, the server returns error 400. I have tried everything, when I remove the field date makes no mistake. My controller: package…
-
1
votes0
answers44
viewsDrools mode stream
I’m using Drools 6 and I’m having a problem getting him to use the mode stream. I tried a few things and they didn’t work out. Here’s the code as it is, it works so far, it inserts the facts, but it…
-
1
votes3
answers490
viewsWhy not use an Application Container like Jboss when using Spring?
Whenever the use of Spring is discussed together with Jboss or other container, professionals tend to question why use a container of JEE applications. So I ask myself, why not use it? Would it be…
-
1
votes1
answer878
viewsTool to Measure Java Software Performance
I wonder if anyone knows any tools to measure theesempenho de um algoritmo. Let me give you an example: I have two sorting algorithms, and I wanted to measure how much tempo, memória and etc.. each…
-
1
votes1
answer454
viewsManipulate json object
I got the following json: { "home":[ { "id":"1", "menu":"1", "title":"Titulo 1", "image":"image01.jpg", "url":"http:\/\/www.exemplo.pt\/images\/image01.jpg" }, { "id":"2", "menu":"3",…
-
1
votes1
answer27
viewsHow to use Microsoft Z3 in java?
I’m doing a job where I need to integrate the Z3 from Microsoft to java Does anyone know how to do that, like step by step?…
javaasked 9 years, 5 months ago Flavio Neves 11 -
1
votes2
answers869
viewsException with Convert from a Primefaces selectOneMenu
I created a dynamic selectOneMenu that takes a Author Object List that implements Serializable. The code is as follows:: XHTML from selectOneMenu <p:selectOneMenu id="autor_selecionado"…
-
1
votes0
answers662
viewsCreating Labels for Zebra Printer
I need to create my own label to print on the zebra printer, if anyone has any experience with it,.. Thanks for your help! Better explaining: I have an application on android, I managed to make the…
-
1
votes0
answers395
viewsMemory Game Two players
I have here a game of Memoria, but still have to implement play against another player.For example I start playing, if you do not hit step to Victory (another player), if you hit I have the right to…
javaasked 9 years, 5 months ago insyspower 183 -
1
votes0
answers118
viewsHibernate Soft Delete Spring Boot Behavior
I wonder if there is soft delete functionality in Hibernate, because today I am doing in a way that I consider gambiarra, something to type: @Entity @Where(clause="ativo=1") Controller: Rejeicao rej…
-
1
votes0
answers198
viewsjava.lang.Runtimeexception: Unable to start Activity
My logcat is displaying a pointer error to start the activity Ouvir I can see but I didn’t find the error. Exiting these messages when I run the application: 11-27 22:09:40.631:…
-
1
votes1
answer308
viewsDeployment of more than one . War in the root context of Glassfish
I have two applications that I need to deploy to Glassfish and I would like to know how to put both in the root context of the same Glassfish. I know that to put an application in root context, I…
-
1
votes1
answer1686
viewsHow do I calculate the perimeter of a triangle in java?
How do I calculate the perimeter of a triangle in java? I don’t know how to calculate the perimeter of a triangle in java, anyone knows? I tried but I could not, help me!
-
1
votes1
answer155
viewsWhat dependencies in Maven to use Jqwicket to integrate Wicket and Jquery
I am developing a Wicket-Hibernate-Spring project. Until the communication and persistence of objects in the bank, it was working normally. After some time, with some scope increase, I need to use…
-
1
votes0
answers196
viewshow to perform all tasks at once?
I can’t get you to perform all these tasks at the same time, only perform the rest when you get some data on InputStream. And once he gets that data, he doesn’t get any more. Please help me, I’m new…
-
1
votes0
answers81
viewsSearch controls in a separate class from the main activity
I need to search the controls to change values in the layout. But passing the context by parameter to the class it does not find the controls declared in xml returning null for each cast made. The…
-
1
votes1
answer177
viewsPre-development questions about android app with data synchronization
I would like to make a simple application to register users using java. But this app should keep a local database for offline data access and a cloud database to sync the information when I click on…
-
1
votes0
answers478
viewsPicking up http request cookies
Good afternoon, I am having trouble picking up cookies when I make an http request for a particular address. Using firefox+firebug I see 5 cookies. Already through my Java program I can only see 1…