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
answer2152
viewsCall another class method
I am beginner in java, and I am creating a basic CRUD of a library, as I have many operations, I thought better to make a specialized class for each operation, which will call the methods of the…
javaasked 7 years, 3 months ago italo vinicius 59 -
0
votes1
answer479
viewsFile path (Java Web)
I’m working on a web project and I’m having a problem with files(java.io.File). The problem is only when running the web application, if it is Java Application the problem does not exist. When…
-
0
votes1
answer99
viewsWriting files to Java
I need to record students' names and grades, follow the code (the switch is to implement other functions in the future). I insert the class (with the directory and name of the text file), the…
-
0
votes1
answer391
viewsSet Floatingactionbutton size on Android
private FloatingActionButton createButton(int id) { FloatingActionButton fab = new FloatingActionButton(this); fab.setId(id); fab.setOnClickListener(new View.OnClickListener() { @Override public…
-
0
votes1
answer35
viewsError in method: removerEditor
I’m a beginner in Java, and I’m having an error in an Edit class method to remove the publisher. The method to remove an author works perfectly with the same logic, already in the remove editor…
javaasked 7 years, 3 months ago italo vinicius 59 -
0
votes1
answer557
viewsProblems with CDI + Weld in Wildfly
I’m trying to create a EntityManagerProducer and it seems in the examples found on the internet something very simple, but it is not being. So I conclude that I am doing something wrong follows my…
-
0
votes1
answer57
viewsFilling an object through another object
I’m trying to fill parameters of one object through another. When debugging the code it stops at that part. First line is 72. The variable pNumer takes the value correctly from JSP. But I believe…
javaasked 7 years, 3 months ago Kennedy Anderson 55 -
0
votes1
answer148
viewsCreate method that takes typed time
How can I create a method that takes the time typed in a field? It will take the contents of the field to save in the database. I use pojo and dao. I made a very short example, what I need to do is…
-
0
votes0
answers199
viewsHow to access the showCallScreenWithDialpad method?
I’m not getting access to the method showCallScreenWithDialpad class com.android.internal.telephony.ITelephony.AIDL. I’ve tried to reflection and I couldn’t. There’s no way to instantiate the class…
-
0
votes0
answers354
viewsSocket with JSON in java
Good night to you all. I have a problem, in case I have a software that runs on port 3333 on a particular computer, and in it has an api, only I need to recover it through another computer and get…
-
0
votes1
answer62
viewsNull.point.Exception when executing another class method
I’m running this code: execution class package aloiexecv2; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; /** * * @author root */ public class…
-
0
votes0
answers96
viewsConversion of a calculation (String) to double
I have a String conta which is always a calculation (4+4, for example), and I want to pass this value to the resultado which in this case is a double, I’ve tried using the method parse, but I was…
javaasked 7 years, 3 months ago Daniel Santos 555 -
0
votes0
answers56
viewsSave background and text to a database
My project is simple, a grid view, with several buttons, and at the click of them opens a popup with 3 options and at the click of them, arrow a text and a background on the button, but when I leave…
-
0
votes2
answers117
viewsCreate a Download according to element id
I created a system that uploads several files, but I ran into the following problem: I need to create a way to download according to the element id in the database. I wonder if anyone has an idea I…
-
0
votes1
answer239
viewsChange the Drawableleft property of a Textview
I have a Simpleadapter that I use in a listview to show data coming from the database. Follows the code Map<String, String> map; for(int i = 0;i < buscaCombustivel.getCount();i++) { map =…
-
0
votes1
answer359
viewsHow to implement Rest application in production? (Web or cloud servers)
Guys, I’m new at low platform and I’m learning java doing a small android project that queries database, but I saw that android is not cool to communicate with database directly, so I learned to…
-
0
votes1
answer878
viewsPassing an Array of Strings to a preparedStatement?
I am trying to pass an array of Strings to a preparedStatement, but it’s returning this exception: java.sql.SQLFeatureNotSupportedException: This operation is not supported. at…
-
0
votes1
answer100
viewsTransfer to "dd/MM/yy" format
I’ve been doing the exercise "6.4 Optional exercises: List of contacts with scriptlet" of Caelum and there is a question that says so : "2) Note that the date appeared in a complicated way to read.…
-
0
votes1
answer92
viewsreadline() returning null
I have a problem with my code. I need to access my website and check the answer it gives me. However readline returns null (End of transmission) right on the first and only line. No error, only…
-
0
votes1
answer1357
viewsPut access restricted login permission
I’m using a code that was already made by someone, I made some modifications regarding what I wanted. This code has 2 types of "Administrator and Employee" access that you would like when you login…
-
0
votes1
answer217
viewshow to position a Jtextfield’s Caret?
I have a JTextField where opening and closing of parentheses is optional. However, whenever the user opens and does not close a parenthesis, my program gives error, because I use this text field to…
-
0
votes1
answer524
viewsJSF - Parameter pass
I have a form in JSF and I need to enter his data in the database I’ve searched several ways, but it’s not working Could you give me a hand with what I’m doing wrong? JSF Form I am not able to pass…
-
0
votes3
answers1010
viewsUpload with ajax and java
I am doing an image upload with ajax (already tested without ajax and it worked). JS: $("#upload").on("submit", function(e) { e.preventDefault(); $.ajax({ url: $("#controller").val(), type: "POST",…
-
0
votes1
answer113
viewsCreate an application shortcut in an onLogClickListener?
The code below creates a shortcut on the device’s home screen, but by clicking on this shortcut, it returns me an error "The app is not installed" How to solve? I would like this mainactivity to be…
-
0
votes0
answers33
viewsHow to get the real path to a file
I upload files to a folder, which works when running in eclipse. But when I try to upload through some browser, I am not allowed due to the security of it. My question is, is there any way to get…
-
0
votes0
answers72
viewsGlassfish duplicating directory
When saving a photo, instead of creating the directory ends up duplicating, apparently it puts the first directory of the Glassfish server and in the other one what I had mentioned, for being layman…
-
0
votes1
answer390
viewsSpring + Bootstrap application with problem to locate contextPath and apply CSS
The page is working normally, but the CSS is not being applied, as well as images within Resources are not being located. Follow methods of the configuration class to locate Resources, and it…
-
0
votes1
answer125
viewsProblem in identifying the turn in the Game of Old
I’m trying to implement the Game of Old in Java with Swing, but my counter that defines the moves, does not change, so always displays the same move: import java.awt.Color; import…
-
0
votes1
answer90
viewsConvert a sql to_date to a java date
My problem is the following, I have to take rows of SQL Insert and check whether the formats in the TO_DATE function in these Inserts are valid with a java method. For a 'DD/MM/YYYY' format,…
-
0
votes1
answer48
viewsValue of h:selectOneMenu is not being set
I’ve created JSF forms several times, but I’m not understanding why value that selectOneMenu not being defined ("set"). <h:form> <h:selectOneMenu id="nova-matriz-select"…
-
0
votes1
answer153
viewshelp with nativeQuery
I tried to query uasndo Expression constructors and jpql , but jpql does not subqueryes and I am , so I try to do with nativeQuery . It is possible? I am getting error message. Would anyone know…
-
0
votes1
answer742
viewsCreating component dynamically
I made a method whose goal is to add a number of checkboxes according to the value of a variable that I will receive. I wanted him to stay inside a scrollPane so he wouldn’t take up more space than…
-
0
votes1
answer95
viewsShow a string in a Alertdialog
Well, I’m learning android, I don’t know much. In this application, so far I just want to present the value of "name" in . Alertdialog setMessage, and I’m not sure how to do it, thanks in advance!…
-
0
votes1
answer84
viewsError reading if. arff file exists or not
I am developing a robot in JAVA along with the Robocode framework and WEKA. Whenever I try to check if the file ". arff" exists, always gives me the same mistake. Round 1 initializing.. Let the…
-
0
votes1
answer316
views -
0
votes1
answer630
viewsHibernate self relationship transforming into json breaks
I am using Hibernate to persist the objects in an embedded HSQLDB file. I have created a method similar to a "Tester" to popular and seek the persistent information. But when I search for the…
-
0
votes1
answer261
viewsEncrypting passwords in web application
I am developing a web application in play framework 1.4 and implemented the critptography of passwords using CRYPTO, but it is not encrypting and consequently decrypting, where I am wrong? In the…
-
0
votes1
answer15
viewslistDataHeader for a String
I wonder if it is possible to return my listDataHeader to a string, because in my system.out it returns the value , but I don’t know how to pass to a string... private void prepareListData() { // //…
-
0
votes0
answers30
viewsRegistration screen
I have a log screen, which compares the edittext text with the database field, and this comparison is working normally. What I would like to do, is that if there was already the field of email in…
-
0
votes1
answer144
viewsImage corrupted using Uploadedfile from Primefaces with Ftpclient
Hello folks I am having problem in Primefaces component "File Upload", while trying to save the file via "Ftpclient" the file gets corrupted. Form configuration <h:form id="formNavegacao"…
-
0
votes1
answer136
viewsHow to save a csv using Hibernate and mysql
I need the following routine to be done: Read some information from the database; Generate a csv based on this data; Write this csv to the database; Start downloading this file to the user. I was…
-
0
votes1
answer411
viewsDoubt concerning Jframe Dispose()
I am trying to check the login screen, to know if there is already the configuration file where the access information is set. If it doesn’t exist, it was supposed to give dispose on the login…
-
0
votes0
answers586
viewsSocket error only on Android 7
This problem occurs only on Android 7! In other versions the operation is perfect. And performing the tests on an S8 with the intelligent network exchange, by the reports of a friend, is also…
-
0
votes1
answer85
viewsImageview of another Activity
How to use the imageview other’s activity? @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { if (groupPosition == 0) switch…
-
0
votes1
answer403
viewsRecovering Edittext text in Alertdialog
Good afternoon, I’m having a problem... When clicking on a button appears the alertDialog custom, IE contains an Edittext in it and a button Positive to the conclusion. Only I need to rescue the…
-
0
votes1
answer26
viewsDate formatter not working
I have a code that supposedly goes to format dd-mm-yyyy or for example 02-10-2017 but my problem is that this code instead of passing to 02-10-2017 is passing to 2-10-2017. Code : dt = 2 + "-" + 10…
-
0
votes1
answer653
viewsError calling a class method inside main
I’m trying to call a method in main, but the class won’t allow me to do it. Error appears: "Cannot Make aStiatic References to the non-static method" I own the class Gerenciamento, where the method…
-
0
votes0
answers46
viewsMultiple Spinners in one
I have a Spinner A ,I would like if I clicked on an option of A,open an option on B,If I clicked on the second item of A ,open a difference in b,multiples inputtext on a single spinner catliv =…
-
0
votes1
answer44
viewsError when relating two tables in the database
I’m with a web project in java, in which I’m mapping towers and patchpanels, where a tower has several patchs and a patch has only one tower attached to it. This relationship is all ok, now the…
-
0
votes1
answer250
viewsRelativelayout "anchored" at the bottom of the screen
Next I want to make this layout (id div_external) below is anchored at the bottom of the screen. But look at the next one it’s at 0dp height on purpose, I don’t want it to appear unless I click the…