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
-
2
votes0
answers92
viewsMaven error: -fuzzyMatcher TYPEVAR
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar (package-javadocs) on project globalmentor-core: MavenReportException: Error while generating Javadoc: [ERROR]…
-
2
votes2
answers193
viewsDriver of the Firebird
I am trying to create a webservice with Firebird. I made the codes based on a Mysql video class and I was trying to change to work on Firebird. But obviously it didn’t work. Let’s go to the codes:…
-
2
votes1
answer53
viewsVariable gets another value even without assigning values to it
I call a Jframe passing as parameter my variable and there I assign it in another variable I declared in order to be able to do the necessary operations. But when I close the Jframe 2 my variable of…
-
2
votes1
answer392
viewsjava.net.Protocolexception: many server redirects
I need to download a file .zip which is located at the following address: http://www1.caixa.gov.br/lotteries/lotteries/lotteries/D_quina.zip For this I created the following method: public static…
javaasked 9 years, 4 months ago Thiago Luiz Domacoski 7,310 -
2
votes2
answers557
viewsQuestion about initialized attributes in the constructor in Java
package Livraria3; public class Livro { private String nome; private String descricao; private double valor; private String isbn; Autor autor; public Livro(Autor autor) { this.autor = autor;…
-
2
votes1
answer69
viewsActivejdbc Compound Validation
I need to do a composite validation on the Activejdbc ORM and I’m not finding anything in the documentation. Something like, extends from the Validatoradapter class, but I’m not finding material to…
-
2
votes1
answer87
viewsImplement a vector that accepts anything
I have to implement an array that is capable of storing objects of any kind. For example: V[3]= valor_int,valor_double,valor_float,valor_String. To do this I was thinking of creating a method that…
-
2
votes1
answer1692
viewsHow to check if a table exists in Mysql
I’ve found several ways on the Internet, but none the way I wanted. I would like a java method for which it checks whether a table exists in the database if it exists TRUE or return FALSE. Grateful…
-
2
votes1
answer81
viewsJava function equivalent to the c++ map()
There is a function for java, equivalent to map() of c++? Basically it calculates the ratio between the values "minimum" and "maximum".…
-
2
votes1
answer383
viewsHow to assign new Selectonemenu value to entity?
I have a table with several columns, between them I have one that is a SelectOneMenu, the table is loaded with a list of Inscricao. In the status column of the application I have a SelectOneMenu…
-
2
votes0
answers75
viewsSet width of Jdialog according to the size of the sums of the columns of a table
I have the column width sum and I need to set this value so that it does not hide parts of the columns and decrease the window. Any suggestions? I created a method that returns the sum of column…
-
2
votes1
answer57
viewsString Validations
I’ve been researching how to validate e-mail, dates, times etc. And in the case of e-mail, I found a code like this: /^.+@.+\..{2,}$/;. It is incomplete. But I wanted to understand what these…
-
2
votes2
answers2008
views"No value specified for Parameter 1" when executing Preparedstatement
I’m testing a insert here and the following error appears to me: Exception in thread "main" java.sql.Sqlexception: No value specified for Parameter 1 Dao package modelo; import java.sql.Connection;…
-
2
votes1
answer206
viewsMake Java Application Run as a Service
I have a Java application and would like it to run as a service on Windows. I researched the net and saw some ways to do it being some more practical and some confusing. Anyone who’s ever done…
-
2
votes1
answer576
viewsIn an MVC project, where should I leave the enums?
I am developing a program with MVC standard, I needed to create some enum, and left them in the layer Model, but I was in doubt about its location, which would be the most correct layer to house the…
-
2
votes2
answers1047
viewsHow to force an html document to always be opened by the browser?
I’m developing a java application for a college job and have a help section for the user where I open a page html in the browser, or at least should open in this. The issue is that if files with…
-
2
votes1
answer3515
viewsHow to take data from a Jtable for storage in a database?
I’m developing a project called Menu List with a Mysql and Java database in Netbeans, with an added Mysql-Connector-Java library. I want the names of the selected products, the quantity of products…
-
2
votes2
answers150
viewsWhat is Forcebrute’s logic of trial and error?
How is it done to make the billions of possible combinations without wasting time? I made a system to generate random letters (he can make all the combinations), but he spends a lot of time checking…
javaasked 9 years, 4 months ago Lucas Caresia 2,663 -
2
votes1
answer455
viewsMicroservices with Springboot
I started to develop an application using the concept of microservices and I still have a lot of doubts. I have repositories and their respective entities, requests submissions work correctly but…
-
2
votes1
answer168
viewsWebsite does not open in my Webview
I made a browser using Webview, but when I call loadUrl(); it opens the page in the default Android browser. How do I open it inside my browser?
-
2
votes1
answer66
viewsFill Serie xls with java POI
I have a code inside a for that takes a certain column and insert the value, and assigns the amounts of lines defined in for, for example Rows =1 ; Rows<=10, put the setCellValue("10/02/2012") so…
javaasked 8 years, 5 months ago Fernando josé 437 -
2
votes1
answer63
viewsPlay! Framework - How to load public files (js, css, img) once?
Hello, I started using Play! Framework a short time with Angularjs, and I’m having problems to use Angularjs services, because if a variable in a page and when I consult this variable in another…
-
2
votes1
answer473
viewsProblem with redirect JSF+Primefaces
I have a menu where I have a submenu Register and inside it a menuItem Usuários in my template, and also have a menuItem Sair. The problem is that the exit only works on the screen Home, which is…
-
2
votes0
answers192
viewsHow to treat exceptions with JTA?
I have a project where I am using JPA with JTA. In the method gravar, I put the note @Transactional(Transactional.TxType.REQUIRED) and in it there is a call to a validation method that can cast an…
-
2
votes1
answer2035
viewsError importing Maven project into Eclipse: No Marketplace Entries found to Handle
I am new to Javaweb programming and when installing the eclipse and importing my project created by Maven, accuses the error below: No Marketplace Entries found to Handle Maven-antrun-plugin:1.8:run…
-
2
votes1
answer122
viewsCorrect form of Scala NULL checking in Java
First of all, I want to say that I’m a total layman in Scala. I know almost nothing but the basics of language. Knowing this, let’s go to my question. I am in a project where there are libraries…
-
2
votes1
answer542
viewsHow to redirect the vraptor web.xml link to a Controller?
I have the following codes below: web xml.: <error-page> <error-code>404</error-code> <location>/error/404</location> </error-page> <error-page>…
-
2
votes1
answer140
viewsCustom jcheckbox does not appear
I’d like to exhibit a JCheckBox larger than normal by default interface. After some searches I found in the link Customize Jcheckbox icons an example to be used, but it does not change the size of…
-
2
votes1
answer670
viewsHelp with connection to sql server 2008 and android database
I made, following a tutorial, the connection of Android Studio with SQL Server 2008 R2 (already existing), with which I was able to make the connection normally, only I have a problem. I can make…
-
2
votes2
answers9251
viewsHow to check a null position in the vector
Why do if(array[i] == null) is not correct? What would be the best way to check if that vector space is "empty"?
-
2
votes1
answer2043
viewsHow to set the location of Jbutton according to the size of a Panel
I’d like to define the location of color1 according to the size of a Jpanel, the same way I did with the fundo public static void janelaPrincipal() { //FRAME JFrame janela = new JFrame();…
-
2
votes2
answers215
viewsGraphics in Primefaces
I have a method that makes a query in the bank and returns me a List, in that List I have three data that interest me: Funcionário and StatusTarefa. Example: I have 2 Employees performing various…
-
2
votes1
answer291
viewsAndroid error while compiling missing lib - System cannot find specified file
Good evening, I had added some libs to my android application, but then I changed my mind and removed them but when I go to compile the code is giving the following error Error:Execution failed for…
-
2
votes1
answer957
viewsHow to put the default android Styles e.g. edittext spinner etc
I could use some help. My android app is in trouble, all the elements I add it plays on the screen in a different way. Ex: when I add an Edittext it does not get the edge only shows the same when it…
-
2
votes2
answers386
viewsListview catching plenty on scroll
My Listview is crashing enough on the scroll, I tried to implement Viewholder to the Adapter but did not solve, could help me? Adapter: public class Adapter extends SimpleAdapter { private Context…
-
2
votes2
answers1306
viewsHow to know the orientation of the screen?
Which code perceives and returns the orientation of the screen? If the cell phone is standing or lying down ?
-
2
votes1
answer150
viewsPanelgrid does not share columns with Repeat
I have a panelgrid that I can not in any way divide in columns a ui:repeat, whatever the amount. <h:panelGrid columns="2" > <ui:repeat var="p" value="#{cadSetor.campos}" >…
-
2
votes1
answer255
viewsHow to print information that is in json format but is printed in a way that allows the user to read?
The application is printing in this json format but I don’t want it to print like this. For example I just want you to print "Translation": "Hi dear" and only. I am using eclipse and the java server…
-
2
votes3
answers441
viewsHow to concatenate string with null without explicitly checking?
When I try to concatenate one String which, in fact, is null with a string valid (e.g., "a"), get the value nulla. See the example below: String a = "a"; String b = null; System.out.println(b + a);…
-
2
votes1
answer649
viewsJSF 2, CDI 1.1, Springsecurity 4: Custom login form does not redirect to page
I’m making an application with JSF 2, Springsecutiry 4 and CDI 1.1. I did the entire implementation of Springsecurity with JSF and apparently everything worked normally, but when making the custom…
-
2
votes2
answers4697
viewsEclipse UTF8 configuration
Does anyone know how to set the eclipse to utf8? I searched in settings but still could not
-
2
votes0
answers277
viewsUse of two different certificates for nfse abrasf issuance
I am sending notes to abrasf using the code below to load keystrore certificate information and tals. Only when sending with a certificate and then with another from another taxpayer refuses to…
-
2
votes1
answer119
viewsIs it possible to implement an abstract class in PHP without the need for inheritance as in Java?
It is possible to perform the class instance in PHP "in the same way" CachorroAbstract in the method main down below: public abstract class CachorroAbstract { public abstract void latir(); } public…
-
2
votes1
answer271
viewsCreate Rest service versions
I am creating Rest services with Java (Jersey). This service tends to grow and evolve, and may undergo changes in existing routines, therefore, I believe that the best way would be to create…
-
2
votes1
answer114
viewsavoid stackoverflow while reading and popular relationships
I’m making a library that populates any model with random values, to be used in tests, but it turns out that when I have a relation like below, I get a StackOverflowException Author @Entity public…
-
2
votes1
answer1973
viewsAdjust columns according to available Jtable size
I have a JTable where the user can hide and then re-display one or more columns. I found a code at this link which adjusts the column according to the size of the "field value". I call this method…
-
2
votes0
answers64
viewsFilenotfoundexception being launched in Twitter search - Java
I have an algorithm that does a search of old tweets on Twitter between two dates. My goal is to return all tweets. The code was as in this question posting (may serve as a parameter) a few days ago…
-
2
votes2
answers235
viewsHow to create an application without a title bar?
I intend to create a web app with a WebView. How can I create an application without a title bar that isn’t fullscreen?
-
2
votes2
answers810
viewsHow to display attributes of an object passed in a list in a JSP page
I am working on a Java Web project, using the Spring MVC framework. I’m having difficulty displaying information that comes from a list where analysts are registered. The name of the analyst is…
-
2
votes1
answer163
viewsReturning value 0 in a java this.Return
I am trying to make a program that brings me the critical path of a list of activities informed by the user, my problem is: my code is returning 0 to the calculation of off. In the image example…