Click here to Skip to main content
15,893,622 members
Everything / Programming Languages / Java / Java SE 6

Java SE 6

JavaSE6

Great Reads

by Andy Point
Android Alert Dialog Tutorial : Working with Time Picker, Date Picker and List Dialogs In this tutorial we will discuss how to use dialogs and alerts in Android Apps. A Dialog is a small popup shown to the user to get some additional information from the user or ask him to make some decision. Alert
by Corinna John
Fun with code and yarn
by Fadi Hania
This is a J2ME beginner article that describes how to add different J2ME components to your application especially StringItems and Commands.
by Jitendra_Jain04
IBM WebSphere Application Server V8.5 Liberty profile is a flexible and dynamic server profile of WAS which enables the WAS server to deploy only required custom features instead of deploying a big set of available JEE components.

Latest Articles

by Vladimir Kolmanovitch
The article allows extracting java.lang.reflect.Method using anonymous class or lambda
by Corinna John
Fun with code and yarn
by Tung.Nguyen.2k
How to implement B-Tree's searching, insertion and deletion in Java
by Paulo Uechi
Uechi APM Web is an APM (Application Performance Management) Open Source Server Performance Monitor written and developed in Java and C # for all Linux and Windows platforms. The Uechi.APM.Web offers a complete resource for unlimited monitoring servers in real time. Have full control of the CPU cons

All Articles

Sort by Updated

Java SE 6 

19 Jan 2024 by Office Systems
I have created Spring cloud config server to include all configurations of spring cloud config clients for my application, the problem is that my spring cloud config clients can not obtain the configurations from the spring cloud config server...
2 Jan 2024 by Office Systems
I'm trying to create Micro-services architecture using spring boot, the only challenge I'm facing at the moment is how to configure spring cloud client to pull all the configurations from the config server, the config server gets all the...
15 Jun 2023 by Shendor
I've already seen some examples with inserting of JComboBox and JCheckBox, but when I insert my own component there is a problem: I can click on the checkbox and button on my component but the component has the same hash-code for all cells of the table. In this case the state of every JCheckBox...
15 Jun 2023 by Member 16030519
how to get a boolean value is true on check box in java netbean code
21 Mar 2023 by Office Systems
I'm having a spring boot project which looks for more than 50.0M documents in MongoDB when fetching from a single table everything works fine however the problem I'm experiencing is when joining two tables in order to check for customer status in...
21 Mar 2023 by Dave Kreskowiak
It takes forever because you're looking for a couple of strings, "Disabled" and "Opted Out", probably without any indexing on the field. This is probably the worst way to get the status in terms of performance. If you were looking for integer...
13 Mar 2023 by Office Systems
How can I compare month in spring mongo criteria with a hard corded value, month in criteria is in a spring format and the value is present in an integer format. This is what i have so far i just want to check for that month and group employee...
13 Mar 2023 by Dave Kreskowiak
Think about your query. What does ".is(2)" mean? Is it the month number? The day of the month? How about the yes? Maybe the hour, minutes, or seconds? How is your code telling the database that the 2 is a month? Hint: It's not.
12 Mar 2023 by Member 12712527
why null is shown when reading from a file. the value inserted are q-1-q-true but the values shown are nullq-null-nullq-nulltrue The code given below:- Scanner sc1=new Scanner(fr); while(sc1.hasNextLine()) { char...
12 Mar 2023 by OriginalGriff
Without access to your files and file system as input, we can't really tell. So, it's going to be up to you. Fortunately, you have a tool available to you which will help you find out what is going on: the debugger. How you use it depends on...
4 Mar 2023 by vor_zakon_developer
I am working a project that we need to receive UN/EDIFACT PNRGOV MESSAGE VERSION message structure file and we need to convert it into java model classes. I have model classes. What I want is to perform this operation using a third part library....
24 Feb 2023 by Member 12712527
if jCHeckBox of one form is checked then how come the checkbox in another form is tobe made checked...?Especially if the checkbox is in a particular column of a jTable..... What I have tried: In DefaultValue.java private void...
22 Feb 2023 by Member 12712527
how to add images to a table cell...? What I have tried: built a class that extends Component public class picIO extends Component{ BufferedImage ig; public void paint(Graphics p) { p.drawImage(ig, 0, 0,this); } public Dimension...
22 Feb 2023 by Richard MacCutchan
add image to a cell of a JTable - Google Search[^]
22 Feb 2023 by Richard MacCutchan
Quote: previously asked this question but didn't got the answer so re-posting As stated you already posted this question at How to add image to a table cell...?[^]. Please do not repost. If you have more information to add then edit the...
20 Feb 2023 by Member 12712527
JCheckbox isn't visible in a particular column of a JTable what to do...? All other types are OK but not the checkbox What I have tried: In file MyTableModel which extends DefaultTableModel I wrote { public MyTableModel(Object...
20 Feb 2023 by Richard MacCutchan
Quote: OKay thank you sir I got it. It was a silly mistake of 'boolean' and 'Boolean'
5 Feb 2023 by Member 12712527
is it possible to program java which is related to quantum mechanics in a PC..? what java package is needed to do that...? What I have tried: tried to search internet where i found quantum computers by IBM
5 Feb 2023 by Richard MacCutchan
Yes, it is possible: quantum mechanics java - Google Search[^]
26 Jan 2023 by Richard MacCutchan
You already posted this question at Sir I have built a package in netbeans (java). How will I import that package in other files ?[^], and I gave you link that explains how to do it. Please do not repost.
25 Jan 2023 by Member 12712527
Sir I have built a package in netbeans 14(java). how will i import that package in other files project name javapckg added a package named myPckg...including a public class named mine Sir how will i add the package rather import it in other...
25 Jan 2023 by Richard MacCutchan
You should have read this first: Java Packages[^].
23 Jan 2023 by Jagannath Sarkar 2023
$(".drum")[1].click(function() { let nextSibling = this.innerHTML; console.log(nextSibling); }); I can't console.log the button using this.innerHTML What I have tried: $(".drum")[1].click(function() { let...
23 Jan 2023 by Richard Deeming
Quote: $(".drum")[1] That returns the underlying HTML element, not a jQuery element wrapper. You cannot attach an event handler to an HTML element like that. You need to use either: $(".drum")[1].onclick = function(){ console.log(this,...
21 Jan 2023 by Andre Oosthuizen
In JavaScript, you can use a for loop to target an element from an array. Here is an example: let arr = [1, 2, 3, 4, 5]; for (let i = 0; i
28 Dec 2022 by Member 12712527
Sir in the constructor i have included 3 combo boxes, each adding 3 different file variable of the same source[ i.e. same path] On running the values are shown correctly.... Also the codes in each of the itemStateChange event of the combo Boxes...
27 Dec 2022 by Member 12712527
How to add element to JList and how to add that JList to JScrollPane...? In code I have marked the message dialog box with three ***. I want to state that when i am including this dialog box the result is displayed correctly and there is no...
27 Dec 2022 by Richard MacCutchan
I have mocked up a cut down version that will display the items from first line of any file. There are obviously many things that need to be added in order to provide what you want the code to do. However, without a detailed explanation I am...
27 Dec 2022 by Richard MacCutchan
You already posted this question at How to add element to jlist and then how to add that jlist to jscrollpane...?[^]; please do not repost.
27 Dec 2022 by Richard MacCutchan
Take a look at How to Use Lists (The Java™ Tutorials > Creating a GUI With Swing > Using Swing Components)[^]
24 Dec 2022 by Member 12712527
I have an application which reads and writes to a file. File is written to the disk. Its ok, object involved are FileWriter, BufferedWriter . Uptill this is ok. but when reading from the same file is involved , FileNotFound Exception arises....
24 Dec 2022 by OriginalGriff
To add to what CPallini says, check your code to write the file: if it does not fully close the stream that does the writing, then the file will be in use with an exclusive lock until your application closes and the lock is automatically released.
24 Dec 2022 by CPallini
From 'The Documentation': FileNotFoundException (Java Platform SE 6)[^] This exception will be thrown [..] when a file with the specified pathname does not exist. It will also be thrown [...] if the file does exist but for some reason is...
14 Nov 2022 by Apoorv 2021
I have a state object with the name firstDig which is as follows:- const [firstDig, setfirstDig] = useState({ firstDigit: "", // first digit to which secondDigit is added/subs/... operator: "", // middle operator secondDigit: "", ...
16 Aug 2022 by prestige meridianpark
I am facing an issue trying to convert Excel file into HTML using Javascript can any one suggest me an solution Link for the file What I have tried: Problem in Converting Excel file into HTML
13 Jul 2022 by Member 10974007
import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import java.text.SimpleDateFormat; import java.util.Date; public class MainActivity extends AppCompatActivity{...
9 May 2022 by br444ndy
I´m trying to looping through a Json... to get a new var = an array made up of months values [enero,febrero,marzo,etc] but I CANT DO IT, because console keeps telling me : Uncaught ReferenceError: data is not defined. Json: "mes": "Enero",...
9 May 2022 by Rajeev Jayaram
Shouldn't data.forEach be inside todo function, async function todo() { const consulta = await fetch("https://raw.githubusercontent.com/br444ndy/c8/main/datos.json"); const data = await consulta.json(); console.log(data); var meses = [];...
9 Apr 2022 by User 15559029
Awesome To-Do List HTML,CSS & JavaScript
9 Apr 2022 by Dave Kreskowiak
There is no "conversion" to jQuery. It's not a language. jQuery is a library of modules, written in javascript, designed to make writing common functionality in javascript simpler, smaller, and more supportable. Is there something in jQuery that...
5 Apr 2022 by Richard Deeming
GitHub - exceljs/exceljs: Excel Workbook Manager[^]
28 Mar 2022 by CPallini
Have a look at Java If ... Else[^].
28 Mar 2022 by Alberto Corena
Write a program that prompts the user for their age and determines if they are a teenager. Someone is a teenager if their age is greater than or equal to 13 and less than or equal to 19. Your program should be able to produce the following...
8 Mar 2022 by pradeep gowda 2022
this is how am getting the id of an gif by clicking on them, but am getting this Uncaught TypeError: Cannot read properties of undefined (reading 'fixed_height'), i want to display fixed_height in UI. {Object.keys(gifs).length === 0 ?...
10 Aug 2021 by Dimiter2011
dnow = Date().toLocaleString() - will give you all you want. Just break on space dnow = dnow.split(" ", 9); Result: (9)�["Tue", "Aug", "10", "2021", "14:16:01", "GMT-0500", "(Central", "Daylight", "Time)"] dnow[4]; will give you current time...
31 Jul 2021 by kowsalya salem
In my Website I'm integrated with firebase real time database and fire store Document Database, It Loading large amount of data for analysis same by default on every page view. if some one intently Programmatically creating Multiple time of...
29 Jul 2021 by Arslan Anjum 2021
How can I get only date and time separately using tolocalestring with date in javaScript. What I have tried: function update_time_zone_2() { let timezone = time_zones_2.options[time_zones_2.selectedIndex].value; let date_and_time =...
29 Jul 2021 by Chris Copeland
There are two functions which do exactly what you're looking for. Date.prototype.toLocaleDateString() - JavaScript | MDN[^] Date.prototype.toLocaleTimeString() - JavaScript | MDN[^]
29 Jul 2021 by Arslan Anjum 2021
Only document.getElementbyID is working. no other JS DOM selector is working What I have tried: HTML ...
29 Jul 2021 by Chris Copeland
You need to start reading the documentation for the functions that you're calling. If you don't understand what the return values of these methods are then you'll constantly need to ask for support. Document.querySelectorAll() - Web APIs |...
2 Jun 2021 by vonhacker
let me explain, some years ago i had one project in university by some bad teacher, i mean he didnt even explain what was java and he gave us that project on our first day, it was so painful to see just one guy did it and it was because that guy...
2 Jun 2021 by Richard MacCutchan
Quote: anyone has a remote idea how you do that? Well, as OriginalGriff says, it is not a good idea for an actual program. However, if you want to do it as an exercise in learning Java then it could be interesting. I would start at The Java™...
2 Jun 2021 by OriginalGriff
Basically, don't. A text-based file is a really bad idea: it doesn't have any structure and it's intended to store human-readable data, and what you are trying to create is anything but that! You are talking about creating a whole database...
12 Feb 2021 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
8 Feb 2021 by Member 13938502
i am trying to print the text "Failed" in Red inside my log i tried the below code but it is not working showing as below instead of printing Failed in Red =java.awt.Color[r=255,g=0,b=0]FailedFailed log4j properties: ...
14 Jan 2021 by slex1one-Musdy
Hi, I am trying to create a function for my array. It is going to take a parameter that i implement which is an array. let dataStorage = [ "08:30", "10:30", "Project", "Nicosia", "12:30", "14:30", "Selef", "Famagusta", ...
14 Jan 2021 by Richard Deeming
Should be simple enough: let dataStorage = [ "08:30", "10:30", "Project", "Nicosia", "12:30", "14:30", "Selef", "Famagusta", "16:30", "18:30", "Deneme", "Kyrenia", "20:30", "22:30", "Sunum", "Laphitos", "20:30", "22:30", "Sunum",...
21 Aug 2020 by Otekpo Emmanuel
May be you should check Fastest 2X2 Array Matrix Rotation Using Javascript[^]
19 Aug 2020 by Member 14917922
Quote: I have creating a html table with javascript function in a page. and i need to create a checkbox in each of the last column in each row from my table1 and if the checkbox is checked then the elements of table1 is to be added to table2...
19 Aug 2020 by W Balboos, GHB
Here's the sense of how to do this (not the code!). It is not the most efficient way to do it but is easily understandable. It will modify the second table every time you check (or uncheck) any of the boxes in the first table. 1 - give your...
12 Jul 2020 by m-2443coding
var matrix=[1,2,3,4,5,6,7,8,9] What I have tried: function(){ var x=document.getElementByTagName('input'); var y=x.length; [x[0],x[2]]=[x[2],x[0]]; x.innerHTML=x; }
18 Apr 2020 by Member 14806047
Just import all the files in any eclipse IDE... Eclipse will automatically provide connection with your database, and now you can convert your jar file to .exe file
3 Feb 2020 by phil.o
android - Error "File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it" - Stack Overflow[^] may be useful.
3 Feb 2020 by varkichayan
While running the command "ionic cordova run android", i am getting an error as the following, the build fails beacuse :" Execution failed for task ':app:processDebugGoogleServices'. > File google-services.json is missing. The Google Services Plugin cannot function without it." What I have...
18 Oct 2019 by RickZeeland
Here you can find an example: Inventory Management System In Java Using NetBeans With Source Code[^] And here is an overview of Java learning resources: https://www.slant.co/topics/4746/~online-resources-for-learning-java[^]
18 Oct 2019 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you. So we need you to do the...
25 Aug 2019 by Klem Lloyd
I am quite new to JavaScript and I have a task to finish a certain app, in the process I have the following requirement: Create a fetchBill function. It should assign https://randomapi.com/api/006b08a801d82d0c9824dcfdfdfa3b3c to an api variable. It should then use the browser's fetch function...
25 Aug 2019 by Member 14568233
Hey there here is how you'd do it fetch(apiEndpoint).then(response => response.json())
4 Apr 2019 by khajak80
import java.math.*; public class Encryption { public static void main(String[] args) { //declaring BigInteger variables for message,e and n BigInteger message,e,n,cipher; //creating BigInteger objects for message , e and n message=new...
4 Apr 2019 by Patrice T
Quote: error at line 14 for message=new BigInteger(args[0]); Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at learnprogramming.Encryption.main(Encryption.java:14) The error message tells you that your code was called with no parameter...
4 Apr 2019 by OriginalGriff
Simpel: you haven't specified any parameters, so there are no arguments to process. No arguments == empty array == error when you try to use any element at all. Add a check for "no parameters", and when that works, add parameters to your run.
14 Jan 2019 by Member 14103872
I have this: -Customer.java: @OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente") private List order = new ArrayList(); -order.java: @ManyToOne private Customer customer; -SoldBook.java @ManyToOne private Order order Is it possible to get a querry that...
30 Oct 2018 by Member1x
Ty changing your code from public static void main(String args[ ] ) to public static void main(String[] args) That should solve the problem.
30 Oct 2018 by WalterCC
Hello! I am having an hard time with a code from my teacher book. In the Code I must display the divisors. I get this error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at Display.main(afisare.java:7) I am really frustrating , can you help me ? Here code: class...
23 Oct 2018 by Member 14029965
Hi, I am trying to learn javascript, and I have the code below. I need to perform calculations with some of my object properties, -find a sum and find the biggest area, for example-. I don't know if I should create an array with my objects (and I don't know how to do this) and then iterate...
16 Oct 2018 by Jenny Jiang
not sure why, After i add public class static main(String[] args) still not compile No main method, javafx application, applets or midlets found in file What I have tried: public class Die { public static void main(String[] args) { private final int MAX = 6; // maximum face value ...
21 Sep 2018 by Richard Deeming
You're not sending the POST data: function getText(){ var a = document.getElementById('text').value; fetch ('chatdb.php', { method: 'POST', headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: "chat=" + encodeURIComponent(a) }) .then...
21 Sep 2018 by Member 13992907
I Can't get it to work. It is complicated to describe the whole project since it's 10 files php only. If you could get this to work i would really appreciate it. function getText() { var $a = document.getElementById('text').value; xhr = new XMLHttpRequest(); xhr.open('POST' ,...
11 Jul 2018 by Ashokyede
Hello All, Zoom in and zoom out doesn't work for real time D3 line chart. It is not able to maintain zoomed in state. I created a real time d3 line chart as code provided in js fiddle http://jsfiddle.net/peDzT/ 1403 / . Chart successfully getting updated after every second. What I want is - ...
8 Jun 2018 by Richard MacCutchan
Add the action listener to your My_name class rather than a separate class. See How to Use Buttons, Check Boxes, and Radio Buttons (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components)[^]
8 Jun 2018 by Member 13865370
i have tried to add action listener to the buttons in my source code but i get a contenuos error that says "you can add action listener to your abstruct buttons" so i was wondering how i would do that...some one pliz help me i have just started learning this java language What I have tried: ...
6 Jun 2018 by Gerry Schmitz
javascript - How to temporarily disable the zooming in d3.js - Stack Overflow[^]
18 May 2018 by Richard MacCutchan
You read the file but then do not do anything with the content. Start with a Collection object(Trail: Collections (The Java™ Tutorials)[^]) that will hold a list of products. Then as you read each line, split it into the relevant tokens and create a new Product object that will contain the data....
18 May 2018 by Member 13833497
Ok guys, i will explain what is the problem here. I'm trying to read a file that contains some informations that i will use later on to create a "product". How can i do it? Because i have trying for few weeks to solve it :( and the deadline is close. Pls help :( What I have tried: This is the...
29 Apr 2018 by Richard MacCutchan
See The Java™ Tutorials[^].
29 Apr 2018 by Member 13803846
Develop a public class MyCircles to the following specifications: 1. The class has a private instance ArrayList, which represent a collection of Circle2D. 2. The class has a zero-argument constructor that creates and initializes the ArrayList instance object. 3. The...
30 Mar 2018 by bizzard4
ArrayList> holder = new ArrayList>(10); holder.get(1).add(10);
30 Mar 2018 by Member 13755400
Also, can I add an int into the 2nd ArrayList in the ArrayList containing int ArrayLists by doing for example: lets say the ArrayList containing int ArrayLists is called holder, and I want to add the int value 10 into the 2nd (at index 1 of holder) int ArrayList in holder. ...
2 Jan 2018 by techtechie
Suppose I have two App A and B.I opened B from A using intent. Now I want to take screenshot of B from A App. What I have tried: I tried Media Projection API and implemented many solutions from Stackoverflow still I am not able to capture image. If you have any reference or resources please...
12 Dec 2017 by Vladimir Kolmanovitch
The article allows extracting java.lang.reflect.Method using anonymous class or lambda
14 Aug 2017 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action. Try it yourself, you may find it is...
23 Jun 2017 by Member 10637246
Now I want to send the message to the people which may be student,teacher or schoolmaster,and all of them have the phone,name and availdSendMsgCount.Before send the message which means insert the data to database,I have to judge whether them can be sent or not.So I write the code like this: ...
22 May 2017 by uzzi7862
Any one got some code for me showing me how to style my gui using css.i kno how to use css but i dont know the code how to link it with java
19 Apr 2017 by scoobyyyy
i want to display the records in jtable from mysql my table contains four rows. Username varchar, Login timestamp, Logout timestamp, Status char. i am trying to display username,login time,logout time and status of the username from the table.need a solution thanks in advance What I have...
9 Mar 2017 by PEIYANGXINQU
Now I use linq4j.I can only sort one property.How to sort the list which object has more than one property?If linq4j do not have this function,what about other method ?My code is here:import java.util.Arrays;import java.util.List; import net.hydromatic.linq4j.Linq4j;import...
15 Feb 2017 by Corinna John
Fun with code and yarn
2 Dec 2016 by Tung.Nguyen.2k
How to implement B-Tree's searching, insertion and deletion in Java
25 Oct 2016 by Member 12702056
public class JavaApplication19 { public static void main(String[] args) { Lesson A = new Lesson(); Lesson B = new Lesson(); Lesson C = new Lesson(); Lesson D = new Lesson("CMS 202", "Applied Linear Algebra", 3, 94); A.setCode("CMS 205"); ...
25 Oct 2016 by rah_sin
Can you bring return GPA; statement out side the for loop and try.
25 Oct 2016 by Kornfeld Eliyahu Peter
Come on!!!Can't you read error messages and trace?Quote:Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - missing return statementIt means you have a method somewhere that does not return a value, but should...So it can not be compiled...Quote:at...