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
votes2
answers4732
viewsHow to automatically adjust a Jframe to the screen size?
I have a program, and when I run on different computers, the window is all broken up and you can’t see the components you have in Jframe, I would like to know if there is any way that the window can…
-
1
votes1
answer332
viewsWeb service made with Nusoap in PHP. I can’t access in Java
I developed a Webservice in PHP, using the Nusoap library. Webservice is already hosted and working. When I develop a client using PHP, whether using Nusoap or using the native PHP Soap class, I can…
-
1
votes1
answer906
viewsDoubts in the use of the dataExporter
Guys, I’m using the primeFaces support to pdf the contents of a datatable. The problem is that the pdf does not bear the name of the columns, only the content. In the examples I saw in the showcase,…
-
1
votes1
answer98
viewsVaadin project error in "pom.xml"
I created a Maven project and put the dependencies, I got the bug in the pom related to dependency Servlet . <dependency> <groupId>javax.servlet</groupId>…
-
1
votes0
answers67
viewsMonitoring the events of the JRE
Can you monitor some jre events like start, close etc? Are there libraries for that? I need to create a log to store the time the jre is triggered, closed and know who accessed, all this should be…
-
1
votes1
answer59
viewsHow to delete a record without affecting the query?
I have two tables PRODUCT and CUSTOMERS. I am using Inner Join to link them in my consultations. I call the product and it displays the product, picks up the customer from the CUSTOMERS table and…
-
1
votes1
answer56
viewsDomain forwarding
Is there any way to redirect the domain to a folder on public_html instead of adding a file index.html with automatic redirection?
-
1
votes1
answer161
viewsOutputtext only updates after Tomcat Restart
I’m using Tomcat 7, Eclipse Juno (on Windows 7) and Primefaces 5 for my application. After registering some information in the database (vaccines for vaccination booklet), access a screen…
-
1
votes1
answer1791
viewsUsing JPA with H2 Database
I apologize for posting my question in the chaining of a similar one. So I’m posting as new topic, ok? I am using the H2 and JPA database to create my tables. Testing my application, I can create…
-
1
votes1
answer894
viewsHow to insert image in Mysql using Hibernate?
I am using java with Hibernate and would like to know how to insert an image in the mysql database. I have several information being persisted with Hibernate, missing only the image.
-
1
votes1
answer243
viewsGet cookies/browser
i know java provides us the possibility to manipulate cookies, but there goes the question. is it possible to obtain cookies from the web browser ? if yes, from which method ?
-
1
votes1
answer116
viewsStop the loop when you find a result
public Objeto busca(String nome){ for(Objeto id : MinhaLista){ if(id.getNome().equals(nome)){ return null; } else { return id; } } } this is the code, it’s returning the id or null repeatedly. how…
-
1
votes3
answers1615
viewsCreate mask for fields
I am developing a system and in it I need to create mask for some fields, the problem that this system was started in a somewhat old version, I can’t say for sure what it is but I will be posting…
-
1
votes1
answer4727
viewsscanf/gets equivalent for java
good people I’m liking programming in java and my doubt is the following, in C language I learned that for the user to type something is used scanf/gets function and in java which would be?? I…
javaasked 10 years, 4 months ago Leonardo V. De Gasperin 713 -
1
votes1
answer121
viewsUse Notificationmanager in a class that is not Activity
I’m having a little problem and I’m not making it. The problem is this: I have a Fragment in my app, and I want to fire a notification from it. The line I’m having problems with is this:…
-
1
votes1
answer692
viewsJava Android Merging Projects
Sometimes I need to use one project in another like a UI framework in my application or something like that and most of them are available in repositories like github etc, I usually download and…
-
1
votes2
answers303
viewsHexadecimal numbers in reverse
How to print the hexadecimal numbers typed by the user backwards? For example: Entrada: 0x101c4701 Saída: 01471C10 If possible in Java and C++. In reality I want to get the information contained…
-
1
votes2
answers914
viewsConsuming data from an external web service, how to instantiate the classes after the "import" of the WSDL?
I have no knowledge in WEB-SERVICES, this being the first time I’m using. After a lot of research I was able to "import" the WSDL file into java and with it "map" all classes of the Web-Service, but…
-
1
votes1
answer1595
viewsBrowse Hashmap<Integer, Hashmap<Integer, Arraylist<Integer>>
I got the following HashMap: HashMap<Integer,HashMap<Integer,ArrayList<Integer>>> hm = new HashMap<>(); When I do this: Set<Integer> keys = hm.keySet(); for(int i :…
-
1
votes1
answer1410
viewsConvert html page to jsf
Well I downloaded a template that will be the index of my project, so it is already configured the web.xhtml, already run other jsf projects, however I am starting another project and I want to put…
-
1
votes1
answer320
viewsJlist Custom Cellrender
I’d like to make a Cor yield with JPanel so that they would be as follows: It would consist of a JPanel, another JPanel inside that would have changed the background and two JTextField or JLabel I…
-
1
votes1
answer119
viewsReturn names of selected items from a checkboxTree
How can I check which items are selected from a checkboxTree ? I have already searched and I know that this code returns the last selected: DefaultMutableTreeNode node = (DefaultMutableTreeNode)…
-
1
votes1
answer220
viewsHow to upgrade the size/color/positions of a sphere within actionPerformed in Java3d
This week I started studying Java 3D but I have a little problem, I can’t move or change the color object within the actionPerformed Although I can change in other places To better understand the…
-
1
votes1
answer131
viewsPassing an id to server socket
Each client contains a fixed id would have as I amnesze that id to the server to then be able to send messages to clients with specific ids? Server: import java.io.IOException; import…
-
1
votes2
answers261
viewsAudioinputstream error ais = Audiosystem.getAudioInputStream(getClass().getResourceAsStream(s));
I create a class to create the Audioplayer package Audio; import javax.sound.sampled.*; public class AudioPlayer { private Clip clip; public AudioPlayer(String s) { try { AudioInputStream ais =…
-
1
votes1
answer3777
viewsResize image in java
I have the following problem. I have an application that takes an image and loads it buffer and then I have to resize it. However, using the method getScaledInstance() the image loses a lot of…
-
1
votes1
answer638
viewsProblem with reading files in Java
I have a module in an application in Java reading and processing files .xls, .xlsx and .csv. It is a web application, where the user uploads a file with some of these formats, via Rest, and when the…
javaasked 10 years, 3 months ago Erico Souza 2,188 -
1
votes1
answer161
viewsFileunput Primefaces does not update the attribute;
I have a repeating structure: <ui:repeat var="item" /> Inside it I print some fields. One of them is the <p:fileUpload/> So far so good. The problem is time to do the action, when I…
-
1
votes1
answer625
viewsHow do I send data from a Jtable to my BD?
I have a filled-in Jtable and need to store its data in a table in my database. How do I do that? I only know the reverse way (fill a table from the BD) am using Mysql
-
1
votes1
answer192
viewssetVisibility for an Imageview of a Grid
I have a grid with an image on each item. On top of each image has another smaller image (visa icon, to say that the item has been selected) only invisible. I’m trying to make when the person gives…
-
1
votes1
answer1150
viewsHow to import the Httpclient library?
Where should I put the library HttpClient? In all tutorials it is possible to find only examples of codes, but no one really explains that after downloading, we should put where?…
-
1
votes0
answers455
viewsRun Java Application on a Server
I have an application made in java that keeps updating my database. However, I don’t want to run it 24/7 on my home computer for obvious reasons (internet may fail, power may fall...). So I need to…
-
1
votes1
answer711
viewsWorking with date: print all dates in a given range
I am struggling with simple implementation. I need to receive the amount of days, excluding Saturdays and Sundays, from a certain date range. I tried using Calendar because I can set the day(date),…
-
1
votes1
answer254
viewsToast validation and seat insertion
I’m taking a risk on Android, I’m very beginner and I’m having problems with my first entry in the database. I also need to validate the fields of my form before sending. If possible, a touch of…
-
1
votes1
answer229
viewsCan I point to project files this way?
Working with PHP is very easy to set up a schematic path for some file, but in Java the scheme may be different? I can point to a file starting, for example, by src File.separator? Example: private…
-
1
votes2
answers1859
viewsError occurs when performing resource injection into the bean
Bean: package br.com.drogaria.bean; import java.sql.SQLException; import java.util.ArrayList; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import…
-
1
votes2
answers630
viewsAdd days to a jDateChooser
I would like to add 45 days on my date2, from the date1 Example: data2 = data1+45 public void adiciona(Usuario usuario){ String sql = "INSERT INTO…
-
1
votes0
answers78
viewsHow to get the type (class) of a groovy list
I have the code below: Set<String> list How to know the type of this list? In case it would be java.lang.String
-
1
votes1
answer84
viewsWrite only one field to the database
How do I record only one of these fields select? Statement stmt = con.createStatement(); ResultSet RS = null; RS = stmt.executeQuery("select codplpag, descricao from pcplpag ORDER BY 1,2");…
-
1
votes1
answer422
viewsMockito-Android Test return method
I’m trying to test a return of a method from my class on an Android project. I’m doing it this way: MyClass var = Mockito.mock(MyClass.class); With this, I already have my instance. Now I need to…
-
1
votes2
answers75
viewsRescue only the Multipart response body
I am trying to download a JSON file, it is sent to me via Multipart, I can recover it but I don’t want to save it in a physical file, so I am taking the return and converting it into string. My…
-
1
votes1
answer145
viewsMethod not found:
When I click the save button to run the method, the following error appears in the console: Jan 15, 2015 4:12:26 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute Advertência: Method not…
-
1
votes1
answer2389
viewsError Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null Object Reference
I’m with this error and I can’t fix it, it works every time I run the app. Logcat: 01-15 16:09:03.380 2473-2473/com.prjctt.allan.financeiro E/AndroidRuntime﹕ FATAL EXCEPTION: main Process:…
-
1
votes2
answers192
viewsAndroid custom listview working but having problems
Hello, I am making a Binding and I have only one of the properties of my Model that are appearing in my listview. Follow the code: Adapter: public class ProjectAdapter extends…
-
1
votes1
answer3271
viewsHow to change the icon of a . jar file?
I would like to know how to change the icon of a file .jar. Is there any way to do this using Scene Builder?
-
1
votes1
answer283
viewsIntercept methods
I need to create a class to intercept the methods of a certain class in order to monitor the execution time, to find out where the bottleneck of my transactions is.
-
1
votes3
answers1547
viewsiReport 3.6 does not open
My team and I work with iReport, I haven’t used mine for a while, but I had to open it for maintenance recently and it doesn’t work. The splash screen displays "Loading cached Objects" and closes…
-
1
votes1
answer421
viewsCalling external file by Div
In the script below it is possible to call an external file through this <div> <div id="script" class="#"></div> Watch this excerpt from the script: https://'+id+'?= how do I make…
-
1
votes1
answer68
viewsRead contents of a netflow package
I’m developing a tool that captures every UDP package that goes through my firewall (an Openbsd 5.4, simulated by a virtual machine), but I’m having trouble extracting the information I need from…
-
1
votes1
answer1344
viewsHow to change Textview of a View in another View?
I’m facing the problem, below: I have 2 xml layout: list_single.xml and tela_authorization.xml I have 1 class: Authorization.class In the Authorization class I have:…