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
votes1
answer172
viewsSearch by dates
I have a screen and on this screen I have a Textfield that is filled by a date in the format dd/mm/yyyy and then I convert that date to yyyy-mm-dd which is the format of java.sql.date so far quiet,…
-
2
votes2
answers4788
viewsSpring MVC and Ajax
I am developing a web app in java using the Spring MVC framework. However, a part of the project has arrived that I am breaking my head!. Before I will show the screen print to facilitate…
-
2
votes2
answers140
viewsPublic method where a date is passed as a parameter, a parameter only
I need to create a public method called mostraData where a date is passed as a parameter (a parameter, not a separate day, month and year) and the date is returned in the following format: dd / mm…
-
2
votes1
answer588
viewsWildfly - "Netty connector not found in main configuration file"
I added a connection factory to the file standalone-full of Wildfly.: <jms-connection-factories> <connection-factory name="K19Factory"> <connectors> <connector-ref…
-
2
votes1
answer1603
viewsPerform actions from the selected item in Jcombobox
I wanted to assign value to another class, whichever is selected in JComboBox. For example, if the "Active" item of a combo is selected I wanted to assign a value to a string from an external class,…
-
2
votes1
answer595
viewsOpen Jfilechooser with filled "File Name" field
How can I open Jfilechooser with the field "File Name" filled? This field of the image below: How to set a name to open as default in this field?…
javaasked 8 years, 8 months ago Rodrigo Lima 315 -
2
votes2
answers784
viewsConfigure IP for server access using Hibernate
I have a Java application that uses Hibernate, for development I made the database configuration using localhost but for use on other computers I will need to define the IP that will have the…
-
2
votes2
answers140
viewsCalling the Java compiler from a Java class
So, here’s the thing, I was wondering if I could call the Java compiler from one running class, to compile another one and generate the . her class. How can I do that?
-
2
votes1
answer685
viewsHow to read an XML file from the server
To create a java desktop application that accesses the internet and le an xml file. Well, this is the initial proprosito. I am using the Socket class to communicate between the server and the…
-
2
votes1
answer623
views -
2
votes1
answer113
viewsSpring Loaded is not working
I have a Spring 3.1.4 project and I’m setting up the spring-loaded follows the image below: The Tomcat performs well but the spring-loaded is not working any change I have to raise Tomcat again.…
-
2
votes2
answers2473
viewsHow to pass arguments when running a program through Netbeans?
This code in notepadd ++ worked because on the command line it added the example port 5000,6000 etc. But in netbeans you can’t do that. That’s why I have here the client and server code. Message…
-
2
votes3
answers182
viewsForeign value when printing array
In java, I’m having trouble understanding some concepts. On a . jsp page, I have the following code: String[] arrayRegioes = request.getParameterValues("numRegiaoUsuario");//object When printing the…
-
2
votes1
answer369
viewsHow to transform a Java String into a Java Array Object?
On a . jsp page, I have the following code: String[] arrayRegioes = request.getParameterValues("numRegiaoUsuario");//objeto When I print the arrayRegioes, the value shown is:…
-
2
votes2
answers5233
viewsHow can I test method with void return using Junit?
It is possible to perform automated testing, in Java, of a method that has return void using JUnit? If yes, how is it possible?
-
2
votes0
answers69
views<p:dialog> does not work
I’m following the example of the showcase but it doesn’t work. An icon was supposed to appear and after I clicked on this icon it opened the Dialog but when I open the page is already like this:…
-
2
votes0
answers323
viewsShow user section in jsp and Servlet pages
I have an application made in JSP and Servlet that works as follows: Before viewing the content of the site the user has to log in, I wanted to add the following function after the user successfully…
-
2
votes2
answers87
viewsPass typed value to another method
I’m having a doubt when passing a typed amount. I’m posting here because I stayed the whole afternoon yesterday and found nothing. In first class: public class CompararLogin { private String nome;…
-
2
votes1
answer221
viewsData sorting: Bubble Sort or Collections Sort method
Which is more efficient to sort a large amount of data passed through an array: Bubble Sort Using the own resources of Collections, for example the method Sort.…
-
2
votes1
answer831
viewsSubquery in the select clause with JPA Criteria
I was searching how to do a subquery in the select clause with Criteria of a select of this type: SELECT tabela1.*,tabela2.*, (SELECT MAX(tabela5.AtrDatatabela5) FROM .Tabela3 AS tabela3 INNER JOIN…
-
2
votes1
answer317
viewsException returned null Java Web
Can someone help solve an exception being generated in my application? I’m developing a Java web application, I just put one input and a selectonemenu in the application to try to save the data, the…
-
2
votes1
answer2244
viewsHow to check if there is a null attribute in the object?
I have a class Person and I want to check if there is any null attribute, any one because I can’t save a person null-attribute. I want to avoid a lot of if. Is there any way to do that? public void…
-
2
votes1
answer180
viewsHow to choose which field to serialize - Jackson
I’m using Jackson to convert my objects into Json. The fields I don’t want to serialize milestone with the @Jsonignore annotation, but in some cases I wish I could serialize these fields. Is there…
-
2
votes1
answer167
viewsAction on the button to center text
Someone could help me as I could do so when I type any text into an input, then I have a button on top of my input in which I want to center this typed text. Could someone help me like I can do?…
-
2
votes1
answer689
viewsJPA does not persist the Object in the database
I have a problem in which I try to persist data in the Database with JPA and Hibernate only that it does not persist the Object. It creates the table but does not persist the data and no exception…
-
2
votes2
answers289
viewsWeka not recognizing attribute in "date" format
I have a treatment and testing suite that I created with a Java program. In the headline, it’s like this: *@attribute data date "yyyy-MM-dd"* And among other attributes. An example of a data line…
-
2
votes2
answers357
viewsJava Generics: Unknown wildcards and T
I was able to verify that in Java we can use both a Unknown wildcard ("?"), and "T" (what is this called?) to create generic mechanisms (classes, methods, interfaces...). But it was not clear to me…
-
2
votes2
answers2262
viewsHow recursion occurs in the following code
I would like to understand, because I can’t see mentally how it occurs in the excerpt: Return fat ː factorial.factoring(fat-1);, the issue of recursion, in what concerns the calls of the method…
javaasked 8 years, 7 months ago Bruno Silva 155 -
2
votes1
answer1732
viewsHow to pick up values and play in another class? Android
I have the following class: public class RetornaUsuarioActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
2
votes2
answers75
viewsUnsatisfied dependencies - Springframewok
Hello! I am studying Spring and I have the following problem to move up the project in tomcat8. My dependencies are not being injected, but I’m not able to identify what is missing.…
-
2
votes3
answers752
viewsUpdate page after download
I am working on a JSF page and I need to download a .pdf. When downloading the object is changed and I need to update it as I cannot allow the same download more than once. But if I use…
-
2
votes1
answer135
viewsPass extra parameters via gcm (google cloud message) - Cordova
When sending a notification to gcm, I added a parameter to the url named 'appUrl'. And I need, when opening my Cordova app, to pass this parameter to the index.html so that I can redirect my…
-
2
votes1
answer222
viewsJava - String - Comparison
I’m not getting a simple comparison I’m making, but it’s not performing like I think it should. Situation I request that the user type the person’s name, and capture with String nome = scan.next();…
-
2
votes1
answer1181
viewsJSF - java.lang.Illegalstateexception: This web container has not yet been Started
I’m developing a website in JSF but I’m new in Web and I don’t really understand how some things work. The site is a crud simple music and make calls to other applications in jar that are in the…
-
2
votes1
answer1068
viewsOpen Jframe in maximized Java
I’m having a problem, I’m creating a Jframe and I want it to open maximized. I’m using the following code: frame.setExtendedState(Frame.MAXIMIZED_BOTH); frame.setLocationRelativeTo(null); The size…
-
2
votes1
answer327
viewsSet which Jframes will focus?
I need to leave a JFrame in focus and not allow use of others, until I close this. Every time you open a new frame the others below it should be dead. How can I do that?…
-
2
votes1
answer128
viewsHow do you know if two periods intersect?
Let’s assume I have two objects that have the following property: Objeto 1: Date dataAtivacao; Date dataDesativacao; Objeto 2: Date dataAtivacao; Date dataDesativacao; How to know if these dates…
-
2
votes0
answers596
viewsHow to integrate a Java system with one in COBOL?
What are the options for a Java system to communicate with a system made in COBOL? Is it possible to use Webservices? If not, JCA would be the best option?
-
2
votes1
answer267
viewsJSP page being displayed as Java Spring text
My JSP page is being displayed as text. I’m using Spring and Spring Security. When I open the link for my browser page it opens as text (All HTML appears written on the screen as if I had opened the…
-
2
votes1
answer128
viewsHow to put only Month and Year in Datapicker (Javafx)
By default (by javafx Scene Bilder) comes the datapicker month, day and year. I would like to know how to take the day, and leave only month and year. If you can, thanks!
-
2
votes2
answers1672
viewsNotification using PHP and Webservice on Android
I have a project in mind but I have not yet started to develop it in practice. The idea is to develop a PHP + Mysql Web system and an Android application using Webservices. My question is whether it…
-
2
votes0
answers232
viewsConfiguration Template jsp using Apache Tiles with Spring
I did all of the configuration below, but the template structure I created using Tiles is not being presented on the main page along with your CSS. If anyone can help! Tiles-config.xml <?xml…
-
2
votes1
answer77
viewsCode snippet in Try
I was making corrections in a class and I came across the following code, I didn’t know it was possible and I never stopped to think, but why is this valid? I mean first line of the Try. For me…
-
2
votes1
answer2729
viewsHow can I browse and edit a txt file in Java
I have a txt file with a text in it I searched on the internet I found some methods for writing and reading, but I have to edit a file that is standard thus changing only some parts of the file.…
javaasked 8 years, 6 months ago Fernando josé 437 -
2
votes3
answers8611
viewsHow to browse lists?
I wanted a solution to go through a practical list. You don’t need to show any results as I will need to scroll through a list of people (objects) and generate accounts receivable from each one, but…
-
2
votes1
answer66
viewsTabbed Activity of Error
Hello, I’ll be as objective as possible: I created a project in Android Studio of "Tabbed Activity" - Action Bar Tabs By app options(right mouse) New -> Fragment -> Fragment Blank created a…
-
2
votes1
answer865
viewsJava - Wait for a method to execute next instruction
I’m making a CRUD app on Android for the college project. I’m using a ImageButton for the person to select the image to be saved. The part of selecting the image and storing it is working fine; but…
-
2
votes1
answer3763
viewsHow to remove Duplicate Objects in an Arraylist?
Hello I have an arrayList of objects. however these objects end up repeating themselves, so I wanted a naneira to remove duplicates. I’ve tried using Hasset, but it doesn’t seem to work with…
-
2
votes1
answer86
viewsjava.io.Console when debugging in Eclipse
I’m trying to use the java.io.Console from within the Eclipse. However, whenever I call System.console() returns me null. In Jetty, it is possible to pass parameters on the eclipse console. For…
-
2
votes1
answer2148
viewsSpring Boot configuration error: org.springframework.boot.autoconfigure.Orm.jpa.Jpabaseconfiguration.jpaVendorAdapter
Hello! I am getting the following Stacktrace below when I start Tomcat with my web project after making the settings with Spring Boot. After I created the following classes below, I’m having this…