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
votes1
answer488
viewsHow to pass exception message to an HTML page from a JSP?
I have a college exercise where I have to create a page. jsp that takes as parameter an "id" and runs a query to delete the record within the class products with this id and in case of any exception…
-
1
votes1
answer719
viewsHow do I make a DAO standard abstract java class to inherit in dao classes?
I want to make an Abstract Class in Java to use in the Dao classes that I will use in several projects, not to repeat the methods of selection, insertion, deletion and update in all dao classes. I…
-
1
votes0
answers70
viewsHow do I set up Java Httpclient to accept Javascript and Cookies?
I need my Httpclient return to be able to run a Javascript and load cookies inside it, someone knows how to configure it so this can be possible? Grateful
-
1
votes1
answer146
viewsHow to have only one Adapter for various Activity?
I wonder if in any way or is it recommended to have a Adapter for each Activity. I know what to do with a Adapter for each Activity is quiet. Now how to make a Adapter generic, would have as? Would…
-
1
votes1
answer97
viewsHow to program to open a specific file type?
I would like to learn how to mess with files, good for example programming in java and work with file CBR, those files HQ or Comic book For this there are libraries specific to each file or class…
-
1
votes1
answer692
viewsI cannot delete input from a Jformattedtextfield
I am making a program and it uses some formatted Jtextfields, that is, Jformatedtextfield that calls a Maskformatter. The problem is that by writing a message and trying to erase it, the message…
-
1
votes0
answers544
viewsSize of the Jpanel screen
I had created a Jpanel with a canvas with a good size. Then I had to replace my monitor with a lower resolution. Now the screen size of Jpanel is small, making that part of the look I put does not…
-
1
votes2
answers194
viewsFunction only returns zero
Good afternoon!! I would like your help in the following question: I have the following function that returns me as a result 0 only: public double calorEspecifico(){ double cp; cp = (fruto.getCp1()…
-
1
votes0
answers41
viewsApk of OCR , ndk build does not want to install
A few days ago I developed an OCR text recognition apk, to make this application it was necessary to install ndk-build. I need to continue the application but on a new computer, however ndk-build…
-
1
votes0
answers692
viewsHow do I get the content of all emails from a user in the Gmail API?
I’m making an application that should receive Gmail user emails using the Gmail API. However, I must receive the data of each email as: content, sender, subject and date received, but I can not do.…
-
1
votes1
answer1116
viewsCommunicating with the Google Calendar API using REST
I’m using Scribe to authenticate with the API of Google Calendar. Authentication with Google is successfully done by returning the accessToken hassle-free. When I try to add one CalendarList,…
-
1
votes1
answer587
viewsJSF agenda with datatable containing data from different lists
I am making a software in JSF (2.2), primefaces and JPA with the Postgres bank. I need to make a schedule of accounts to pay with the following columns and their data: Column before yesterday with…
-
1
votes1
answer205
viewsHow do I call the intercept() method of an Intercept class, in another project method?
All right, guys? Well, I’m having a hard time and I’d like a little help. I have the following method from my Acessarintercept class: @Intercepts @RequestScoped public class AcessarIntercept {…
-
1
votes1
answer9581
viewsMulti-thread in Java Socket
I have no Java experience, so once again, I turn to Stack to help me, I have a basic code from a server that receives a message from a client via socket and the code from that client, I need to…
-
1
votes1
answer1714
viewsHow to create a vector that displays the frequency of each element in a matrix?
"Write a method frequency which receives data from a matrix A that has integers between 0 and x; generates a vector with the occurrences of each integer between 0 and x. Write a method greater that…
-
1
votes2
answers8637
viewsMaven build error - Could not resolve dependencies for project
This message appears on my Maven app I tried to build a Maven with the clean package command [INFO] Scanning for projects... [INFO] [INFO] Using the builder…
-
1
votes1
answer842
viewsSoftware Licenses
I have the following doubt regarding the use of software licenses. Today how it is done and how it is most used to create licenses to use a software, highlighting that I have an application…
-
1
votes1
answer186
viewsMaven not finding java
I’m trying to run the Maven and is returning me the following error: /opt/apache-maven-3.3.3/bin/mvn: 227: exec: /opt/jdk1.7.0_79/bin/java: not found I checked the paths and are ok, someone knows…
-
1
votes2
answers86
viewsApplication closes at the touch of the button
When one or more EditTextare empty the tap on the button should show the message of the Toast, but the application closes. Why? public class HomeActivity extends Activity { int rcpNum, fckNum,…
-
1
votes0
answers120
viewsJava Serial Communication
I developed an application in Java that communicates with microcontrollers through serial ports, in the tests performed in Windows everything went perfectly well but in Linux, more precisely in…
-
1
votes0
answers131
viewsUpload JSF Multiple Photos
I need to make a registration screen, where the user can choose up to 5 photos to save. I am using JSF 2.2 would like to know the best way to do this without using primefaces or richfaces, using a…
-
1
votes0
answers47
viewsHow to create a Jar and export from CVS?
I need to turn a project into Jar in CVS but I’m not getting, someone knows how to do step by step?
javaasked 9 years, 4 months ago daniel12345smith 2,120 -
1
votes1
answer1575
viewsHow to run java at the Eclipse prompt
I made a code in java and in it I use " r" that only works at the prompt and I would like to know how to run this code at the prompt by the eclipse itself.
-
1
votes1
answer97
viewsSearch Locations by category
I’m using the google Places api that returns a JSON, managed to search for sites by lat and long and also by placeid, now I need to search the site for tipo/categoria for example: restaurant, gym,…
-
1
votes1
answer465
viewsBreaking net.vidageek.mirror.exception.Reflectionproviderexception error: Could not invoke method, how to fix?
I am in a code where at the moment I run this java method from Htmlunit: // SIMULANDO UM NAVEGADOR WebClient client = new WebClient(BrowserVersion.getDefault()); client.setJavaScriptEnabled(false);…
-
1
votes1
answer2947
viewsError: package javax.Servlet does not exist import javax.servlet. *
I created the directories correctly, copied the code and now does not compile and returns this error. I am compiling by the terminal using javac. http://pastebin.com/WLaGQit3 package…
-
1
votes1
answer512
viewsIssues with nfe WSDL import
I’m having an error that I can’t figure out what it is. I took the SWDL from Nfeauthorization (homologation) and used the Axis2 to generate the classes. I solved some import and lib problems, but…
-
1
votes2
answers602
viewsUpdate Jlabel with regressive count
I have a For that makes a countdown, but when I will pass the value to the Label it only takes the last value of the loop. This is my method: public static void contagemRegressiva(){…
javaasked 9 years, 4 months ago Caio Micheletto 11 -
1
votes1
answer340
viewsProblem with @Autowire Spring + Hibernate and Junit
Good evening, I’m trying to create a project using Hibernate and Spring, I was successful creating some configurations, including I was able to generate the database by booting the application using…
-
1
votes1
answer662
viewsComparison of Mysql hours
I have an agenda where I register an appointment, that commitment has Hora Inicial and Hora Final. However now when I register a new appointment I have to make a check to see if the hours are not…
-
1
votes0
answers106
viewsException java.util.Concurrent.Rejectedexecutionexception:
Good afternoon, I’m back from a JEE project where I used jms and the server is wildfly 8.0. I’ve been working on this exception for a while, but I haven’t been able to figure it out yet. I don’t…
-
1
votes0
answers393
viewsSoftware Nfe in java
I have a project to create an Nfe emitter in Java... But the problem is that I don’t have much idea and much knowledge for the development of this type of project. Does anyone know if they have a…
-
1
votes1
answer933
viewsAlways focus on Jframe
I need that when I click on some button of my application the focus returns to the JFrame. Is there any method for this? I could call the method MeuFrame.requestFocus() in each ActionPerformed, but…
-
1
votes0
answers729
viewsAPI for reading OCR(Optical Character Recognition) with ANDROID
Good evening folks, I would like to know if anyone knows or has ever worked with an Api that provides OCR read solutions for Mobile platform. If possible list some for me. I thank you already.…
-
1
votes1
answer584
viewsHow to treat error 404 and 500 in vRaptor?
I have seen tutorial of vraptor4 teaching to put this error in web.xml, to redirect, the following xml code: <error-page> <error-code>404</error-code>…
-
1
votes1
answer797
viewsAdd event (action) when switching tab
I have a Tabpane in my project that contains 3 different tabs, I would like to know how to add an event when changing "tab" in Javafx. For example, by clicking on the "address" tab, create an event…
-
1
votes1
answer1895
viewsHow to pass arguments in the Eclipse Ide console?
How to pass arguments in the Eclipse console? For example this program: public class Eco { public static void main(String[] args) { for(int i=0; i<args.length; i++) System.out.println(args[i] + "…
-
1
votes0
answers27
viewsA "extends Tabactivity" class cannot instantiate methods from other classes?
I made some tabs via java code and needed to receive a method from another class that would return an array, scan the array and fill my tabs, but from the error of "Nullpointerexception" and when I…
-
1
votes2
answers357
viewsHow to hide title from Jtabbedpane tabs?
I need to hide the titles of JTabbedPane because I’m creating my own buttons to access the tabs.
-
1
votes1
answer1576
viewsHow to access the Serial port of a computer in Java?
How do I access/control a Serial Port through Java? Currently I was able to access in C++, but in Java I don’t know how to do. Any suggestions?
-
1
votes2
answers1106
viewsorg.openqa.Selenium.Elementnotvisibleexception: Element is not Currently Visible and so may not be interacted with Command Duration or timeout
This exception happens when the some tests run on Amboo. The strange thing is when I run locally it works and are random tests that break. Someone’s been through it? The Exception is this:…
-
1
votes1
answer350
viewsDisplay an alert when the event is 5 minutes away
I am developing an agenda in Java, where I have in the database the date and time saved. However, what would be the best way to display an alert 5 minutes before the event? Do I have to run the…
-
1
votes0
answers75
viewsHow to create all the possibilities of a scheme with a loop?
For example, make A, B, and C switch places with each other, and then define how many and all exchanges. ABC, ACB, BAC, BCA, CAB, CBA, etc. I want to do this with for and prefer Javascript, but it…
-
1
votes1
answer7551
viewsPick up the selected item in Jcombobox
How do I get the user selected item on this Combobox? opcaoBusca.setModel(new DefaultComboBoxModel(new String[] {"Op\u00E7\u00E3o da Busca", "N\u00FAmero do Pedido"})); entBusca = new…
-
1
votes1
answer194
viewsChange script variable value via Java application
I created a script where inside this script there’s a bond like while. The condition for that while is escolha != 1. Everything works ok, but in the middle of this while i run a Java application…
-
1
votes1
answer166
viewsGroup Textviews and then access them
Example: I have 3 TextViews and its id's: TextView tv1 -> id: "um" TextView tv2 -> id: "dois" TextView tv3 -> id: "tres" I would like to group them in some way that I can access them…
-
1
votes2
answers691
viewsWhat is the best way to query SQL Server database using a list as input?
I have a question as to how best to address the following problem: I need to query records in an SQL Server table using a list of serial numbers. I know the IN command, but it does not meet, because…
-
1
votes1
answer809
viewsError message after opening Excel file generated by an application
I have an application that reads a file xml, takes the data and passes to a file in the format xls. But when I open the file that was Erardo appears the following message: Would someone explain to…
-
1
votes1
answer78
viewsEclipse settings
At the time of installing the SDK by eclipse how do I add the third party library add-ons and Android Repository I’m using the latest version of the eclipse called eclipse Mars!
-
1
votes2
answers355
viewsChange Status Bar to transparent in a Fragment within an Activity
I have a Activity which has a theme for its Status Bar, but it has an influence on a Fragment I want another color in the Status Bar. Is there any way I can change the color of the Status Bar just…