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
-
0
votes1
answer137
viewsError consuming REST Java Arraylist<String>
I have a Maven web application in Netbeans running on Glassfish 4.1.1, and a basic CRUD class has been created to receive and return in JSON format, but when a CRUD will be returned…
-
0
votes1
answer79
viewsConnection to database and mapping
@Techies I re-asked the question with an appropriate title, based on the initial doubt in: What to do after mapping? Hello. Following the guidelines of another post, I have some questions, starting…
javaasked 9 years ago André Nascimento 1,258 -
0
votes1
answer62
viewsConditional Change of Activity
Hello, I have a problem, I want to create a conditional on an Activity, inside a button, to open another Activity in my app. But how would that parole? My app has buttons in main Activity that leads…
-
0
votes0
answers490
viewsPhysical and Juridical Person
I have a field which can receive physical or juridical person, as you model it ? through interface, composition or heritage ? I have the following class structure: Contacts (PF only) -- belongs to a…
-
0
votes1
answer53
viewsHow to convert String to Double using JSP FMT EL
Hello I have a 9.9 string, I would like to convert into 9.9 and double to add Currently I use it like this: <c:set var="media" value="0" /> //onde a funcao.valor é uma string 9,9 <c:set…
-
0
votes1
answer199
viewsRemove selected item in new selection in spinner
Hello I would like to remove an item already selected in the android spinner. Example: ItemA ItemB -> SELECIONADO ItemC ItemD Since Itemb is selected I wouldn’t want it to appear in the list when…
-
0
votes1
answer610
viewsJavascript upload image (GIF)?
I am trying to show a loading image on my pages using these functions: $(document).ready(function(){ $(".loading").hide(); $.unblockUI(); $(".menuLink").focus(function() {…
-
0
votes0
answers903
viewsPersist field blob with file extension - JPA, Hibernate
I need to persist an attachment as a pdf, xls, etc. (type field blob). I need to recover this file after persisting it and I don’t want it to be necessary for the user to inform the file extension.…
-
0
votes2
answers156
viewsGrab Files on Drive C:
Using the code: System.getProperty("user.dir")+"\\email\\email.properties" it picks up from the user (C:\USUARIO\user\Documents\Netbeans\Projeto\email\email.properties) but what if it’s in the unit…
javaasked 7 years, 11 months ago adventistaam 3,354 -
0
votes1
answer211
viewsArrayindexoutofboundsexception error while executing code
My code is giving the following error: Exception in thread "main" java.lang.Arrayindexoutofboundsexception: 10 at t151.main(t151.java:19) What it means and how to fix? Follows the code: public class…
-
0
votes1
answer58
viewsSend a message to all
What resources could I be using to display a notification on a page if an Exception occurs within a Servletcontextlistener that runs a thread? The idea is to warn the user that something is out of…
-
0
votes3
answers289
viewsOimundoservlet.java - #algaworks
I am following the E-book "Java EE7 With JSF, Primefaces and CDI". I created the Maven project, edited the file pom.xml how the workbook guides, when creating the example file OiMundoServlet.java, I…
-
0
votes1
answer787
viewsInput values into the matrix
I have the following code that reads a 10x10 matrix: public class t151 { static final int n = 10; public static void main (String[] args){ int A[][] = new int [n][n]; int i,j; for (i=0; i < n;…
-
0
votes1
answer876
viewsChecking of special characteristics
I need to do a check on a string on java which allows the user to insert a normal accent, but does not insert special characters such as: @#!$! etc.. I did something similar to check numerical and…
javaasked 7 years, 11 months ago Castegnaro M. 3 -
0
votes1
answer142
viewsHow to use a selection setBackground in custom Renderer?
I’m trying to use a render Cell, so when it shows monetary data, it does the formatting. However, when I apply the render in a particular column, the focus in that column does not have the…
-
0
votes2
answers563
viewsGives success message that saved, not error message, but in the database is not saved - jsf
My code is giving message of success in saving the record, but in reality it is not saving, I have already checked in the database, is not generating error message, and presents the code all right,…
-
0
votes1
answer46
viewsProtect HTTP Requests with Android
I have an Android application, which requests Servlet or JSP files that return JSON. For example, in my application the user logs in and can add requests, when adding requests, the same is added via…
-
0
votes0
answers468
viewsinvalid stream header: 00000000
Good evening. I am trying to read all the files from a directory on one machine (client) and send to another machine (server) using Java Socket. However, at the end of the transfer I get the…
-
0
votes2
answers318
viewsJava Routine Inside Loop Repeat
I have a Java method that sends an email with an attached doc, and is working properly. But this method takes about 50 seconds running the entire sending process. But now I will need to run it…
-
0
votes1
answer93
viewsUse an sql class. Connection for each task or just a globally referenced one?
I have a class that is responsible for verifying the user’s account and password when logging in, and in the future I will need to implement another class to get other data in the database and…
-
0
votes1
answer131
viewsFinish all daughter threads of an Activity
In my Activity I instill some controls that search server data asynchronously. The control instance is as follows: new controle().executar(new InterfaceRetorno(){...}); But what happens is this, if…
-
0
votes2
answers99
viewsSpinner behavior with database data in Lifecycle
I have 3 Spinners inside a Fragment, the problem I’m having is when I rotate the Tablet screen and the screen rebuilds, so the Spinners are zeroed. The first Spinner comes from the bank, depending…
-
0
votes0
answers50
viewsListview error
Good afternoon, I have an error that came up after having edited a function to save data by Dialogfragment, in logCat presents the error that and my Listview is null, only that I can not take the…
-
0
votes1
answer49
viewsWhy a Stored Procedure generates different results if run in Workbench and Java with JDBC
I have a Stored Procedure in Mysql that is working normally when running from Workbench, but by running this same procedure in Java/JBDC I am getting wrong values and different from those obtained…
-
0
votes1
answer244
viewsHow to show a confirmation message after checking in Servlet?
Good afternoon, you guys! By clicking the Change button, I perform a check to see if the data in the database remains the same. How do I return a confirmation window if the results are not the same?…
-
0
votes1
answer375
viewsHibernate brings the incomplete object (without foreign keys)
I have a jsf+Primefaces+Hibernate application, when I go to make a query in the database Hibernate returns incomplete objects. This happens for all classes but I will use the questions class as an…
-
0
votes1
answer57
viewsSearching for data in another database Schema using createQuery
In postgres, we can search for data in various schemas through sql itself. Doing so: SELECT * FROM meu_schema.minha_tabela It is possible to do this using the createQuery? By default, my application…
-
0
votes1
answer67
viewsConvert weight into money
I’m trying to convert weight into money, but every time my answer is zero and I calculated here and nn should give zero kkkkk someone can help me Obs: the 5 is the price per kilo (This job will make…
javaasked 7 years, 10 months ago Felipe Moreno Borges 35 -
0
votes1
answer208
viewsHow to print the Browser or OS name on a JSP - Java Web
would like to know how to print the browser the client is using and if OS using jsp. Some people suggested using ${header["user-agent"]} however, this command returns various information and I would…
-
0
votes1
answer812
viewsno such column _id (code 1) while compiling - SQL
I’m having trouble with my code, could help me. Follow the error below and soon after, the codes. But to simplify, I have a home screen and let me go to another to register and then I can go to…
-
0
votes0
answers71
views -
0
votes0
answers47
viewsGarbage Collector from Visualvm
I have a Java web application running Spring on Tomcat 7.0. As the days go by, the use of memory goes up slowly and does not go down much, although by the Visualvm I realize that the GC runs…
-
0
votes1
answer200
viewsViewpager with different content on pages
I can’t create different pages with Viewpager, I took a tutorial that explains how to use the component without Fragments, but you don’t have the information I need to solve this problem. Follow the…
-
0
votes3
answers109
viewsValue is not being written to the bank
I have the following entities: package br.com.pokemax.modelo; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import…
-
0
votes1
answer99
viewsUncover partition
I’m creating an application that will run from an external hard drive. I have been researching but I haven’t found a way without using too much gambiarra to find the partition where this hard drive…
-
0
votes0
answers100
viewsPrevent simultaneous access Tinyradius
I’m using the Tinyradius in a Java EE application and in this application the simultaneous access of the same user cannot be allowed, but Tinyradius itself does not implement such a requirement.…
-
0
votes1
answer472
viewsHow to generate a jar through ANT?
I’m using Jdeveloper in conjunction with Ant, however I came across a very boring situation... I can’t generate one. functional jar through ant. I have already built a build.xml that contains the…
-
0
votes1
answer689
viewsJSF ui:Composition component does not work
I’m creating an example template but when the page opens it goes blank, it follows the template and page that tries to pull up the template: master-template.xhtml: <?xml version="1.0"…
-
0
votes1
answer146
viewsHow to pass drawable file as parameter?
I have a problem that should be simple, I want to move to another Ctivity, a drawable as parameter. here is my Onclick function: img1.setOnClickListener(new View.OnClickListener(){ @Override public…
-
0
votes1
answer425
viewsWhy isn’t the object being instantiated?
I have a Bean class (Casa.java) public class Casa{ //atribubutos private String parede; public Casa(){ } //getters e setters public void setParede(String parede){ this.parede = parede; } public…
-
0
votes1
answer50
viewsOpen an . exe file inside a . jar file
Good! I’m new to Java and I’m developing a program where I need to include it in a driver executable. By running the file . jar, how can I make you run the . exe file? I have to extract it and then…
-
0
votes1
answer53
viewsWhy should I create a static method and not one that could instantiate the class and use this method?
I really don’t see any difference in these two methods uses. Could someone be more specific with me and inform me about this?
-
0
votes2
answers319
viewsLike passing a Char to the bank?
How do I pass one Char to the Bank? Error Exception in thread "main" java.sql.SQLException: ORA-12899: valor muito grande para a coluna "SYSTEM"."USUARIO"."TP_SEXO" (real: 2, máximo: 1) at…
-
0
votes2
answers126
viewsHow do I limit the use of a web application so that it can be used by Chrome?
My application is based on Java and made in Genexus. I want it to be impossible to use my application outside of Google Chrome. You can implement this limitation? I did not find in my research this…
java web-application google-chrome browser genexusasked 7 years, 10 months ago Tayrone Carneiro Rockenbach 91 -
0
votes2
answers1509
viewsHow to add items in a dynamically Java combobox?
I have a project in netbeans that uses Java Swing for the interface. I have some data in MYSQL that I would like to show you as soon as the window is created. Anyway, how can I place items in a…
-
0
votes1
answer275
viewsavoid confirmation of resubmission form
I’m developing an application and when I click save it redirects to where I want updated. Only if I refresh the page it asks if I want to take advantage of past data before, I wouldn’t want it to…
-
0
votes1
answer7043
viewsSqlexception: Parameter IN or OUT absent from index:: 10
It’s the first time I’m working with connections, we’re doing a job for college on a social network, now we’re doing the method insert. My doubt, when I run the test class it returns me an error.…
-
0
votes2
answers354
views -
0
votes1
answer1009
viewsPick a specific part of a string using ANDROID split method
I made a code to display processes on android but when printing in a text view, it prints the PID, process name, memory cpu usage etc. The display is this way 958 2 0% S 22 577164K 42624K bg u0_a63…
-
0
votes2
answers349
viewsCheckbox - how to check if at least 1 cbx has been selected
Hello, I have a set of 8 checkBoxs. Does anyone know how I check if at least 1 of them was selected? Thank you