[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Java

99K

Solutions

33K

Contributors

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

Share tech news, updates, or what's on your mind.

Sign up to Post

How to set the default font size in Java application ? The size shown in JOption frame is small.

Thx
0
C++ 11 Fundamentals
LVL 12
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

I need to create a small game.   I want to create 3 JOPtionPane for 3 users. Each user will ask some questions on each JOptionPane and the result will be instantly updated on the JOptionPane (ie. the message on the pane will be changed dynamically based on user input). Any example to show how it works ?

Thx
0
Hi
I have Oracle SQL Dev version v17.4 with Java Platform 1.8.

I would like to connect to an Ms Access table but i can't see the tab. How can I add it?
Oracle Missing Ms Access tab
In an older Oracle SQL Dev, (1.5), i do have that tab.
0
Dear  sirs,
Please help with the following.
I would like to know how to access extra parameters (besides username and password), when dealing with Spring Security Login form.
Please, assist.
A sample of code will be helpful.

Omer
0
Dear Experts

I am in the process of internationalizing a Java swing application, which has worked out quite well. Now I just want to internationalize some default values of a jTable. How do I do this? I have managed to internationalize the headers of the columns, but how do I internationalize the default texts placed in the first column?

Best regards
Jorgen
0
It would be fair to say that I have around zero idea whether I am on the right track with this one or not, which is to get into the Windows Registry with Java. I need to read a value or two from there. Don't need to amend or write any new values.

So I borrowed a piece of code from elsewhere on the 'net, the narrative of which says that it can access the registry for such read write ops. It's reliant on Preferences, and the code itself seems to be for static access only, which means that I simply compile it, and supply my own tiny class to call the one method that looks like it should deliver the entry I am looking for.  (I'm fishing for the KV pair for a USB memory stick, which is held by HKEY_LOCAL_MACHINE somewhere).

All the code compiles and seems to run, but I can't see past this error, nor why (fundamentally) it occurs, and even less do I know what to do about it :
Nov 08, 2018 12:06:44 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0
x80000002. Windows RegCreateKeyEx(...) returned error code 5.

Open in new window


If anything I've said makes sense and there's a suggestion what should come next,, I'd be pleased to hear.
0
Hello,

I never tire of asking me: To be a good programmer, what is the relevance of getting a degree in computer science? And a good programmer has in mind all the commands of a programming language, like PHP or JAVA? The oldest languages (MSDOS) had less than 200 commands and functions, currently they must have more than 1000

I would like to hearing from you

sincerely
0
what i need to add for my  thread execution timing in jmeter
0
how to  run my  java sampler continuously 4 hr in jmeter for load test
0
How to run 2 java sampler simultaneously (parallel)  in jmeter .  any link or suggestion
0
OWASP: Avoiding Hacker Tricks
LVL 12
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

Hi
We talked a little about my approach to teaching neighborhood kids and adults, even, how to code.
I think we decided against going all out on Python right away. Do you still agree? I'd like to hold off on Python for a pure newbie.
K-12 focuses on Java, so I think Java for them is obvious.
I also think so, because polymorphism and class design will be important for making tablet, phone apps, as they are seriously non-novice projects. - Java will make 4 an easy transition
I'm going to start them off on Java and when they are blatantly ready, switch to Python, or their preferred device.
I could do Java and Python side-by-side?
Any suggestions?
Thanks
I'll start early next year

My padowan coders will excel
0
how to load mutiple jks file(keystore) file in jmeter.
0
Hi Team,

I have the below error for my program . I have defined the method in the class , even then Iam getting this error

Multiple markers at this line
      - Line breakpoint:SeverityConstantsTest [line: 16] -
       main(String[])
      - Line breakpoint:SeverityConstantsTest [line: 18] -
       main(String[])
      - The method getHoursForFix(int) is undefined for the type
       SeverityUtil

Below is my code

SeverityConstants .java

package Enums;

public class SeverityConstants {
public static final int LOW=0;
public static final int MEDIUM=1;
public static final int HIGH=2;
public static final int URGENT=3;
}

===============================

SeverityUtil.java

package Enums;

public class SeverityUtil {

      public int getHoursForFix(int severity)
      {
            int hrs=0;
            
            switch (severity)
            {
            
            case SeverityConstants.LOW: hrs=24;
                                                      break;
            case SeverityConstants.MEDIUM: hrs=12;
            break;
            case SeverityConstants.HIGH: hrs=6;
            break;
            case SeverityConstants.URGENT: hrs=1;
            break;
            }            
            return hrs;            
      }      
}
=======================================

--SeverityConstantsTest.java
 
package Enums;

import java.io.Console;

public class SeverityConstantsTest {

      public static void main(String[] args) {
            // TODO Auto-generated method stub
            
            int severity=0;
            int respHrs=0;
            
            SeverityUtil sutl = new SeverityUtil();
            
            Console console= System.console();
            String str = console.readLine("Enter the Severity");
            …
0
I don't have the admin right to install PDFsam so previously I just copy over the
entire folder from a working WInXP to my Win 7 (64bit) & create a shortcut to
c:\PDFsam Basic\bin\pdfsam.bat   & it launches with a slight message.

However, when I now do the same from my Win 7 to a Win 10 (64bit) that has,
it won't launch, giving the error below:  is this due to the java version the
Win 10?
C:\Program Files (x86)\Java\jre6\bin>java.exe -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)


the message:
==========
C:\PdfSam Basic\bin>pdfsam.bat
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/pdfsam/community/App : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(Unknown Source)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown …
0
So i have chart js on my page .
It displays number of users over time. Time interval is 2 hours so over a month i get lots of data.
All works fine but i would like to hide x Axis labels only - with ticks remaining intact.
Where and what  options would go in this file for no labels below x axis?

<!DOCTYPE html>
<html>
<head>
<title>/Prototype.</title>
<style type="text/css">
BODY {
    width: 750PX;
}

#chart-container {
    width: 100%;
    height: auto;
}
</style>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/Chart.min.js"></script>


</head>
<body>
    <div id="chart-container">
        <canvas id="graphCanvas"></canvas>
    </div>

    <script>
        $(document).ready(function () {
            showGraph();
        });


        function showGraph()
        {
            {
                var id = location.search.match(/[?&]id=([^&]*)/)[1];
                
                $.post("xxx.php", {"id": id}, 
                function (data)
                {
                    console.log(data);
                     var date = [];
                    var users = [];

                    for (var i in data) {
                        date.push(data[i].date);
                        users.push(data[i].users);
                    }

                    var chartdata = {
                       labels:date ,
                        datasets: [
                            {
                                label: 

Open in new window

0
How do I know if our corporate users will have a problem in 2019
0
Array Out of Bounds:

Dear Experts,

I have tested the following code below and have come across some minor issues.  The following is to accept input from the user with two exceptions thrown as a result if there is an out-of-bounds and or if the user inputs the wrong substring length. The code must use a substring and a split() method, as well as a loop in the catch exception.

The output is suppose to be as followed if requirements are not met. If the requirements are meet they are displayed:

Enter your full name: Marie Janet

Marie Janet

Enter the beginning and ending index number of your lastname: 4 9

Not correct number for extracting your last name.

Enter the beginning and ending index number of your lastname: 42 42

Not correct number for extracting. String index out of range: 42

The following code is attached.

EDIT: Hello Experts the code is here: abound.java
0
I am having trouble with the attached file. Below is the error.

SimpleApp.java:2 error: class, interface, or enum expected
<dependency>
^
SimpleApp.java:77: error: class, interface, or enum expected
}
^
2 errors

C:\Usersjmcs1\Desktop\java>javac SimpleApp.java
SimpleApp.java:2: error: class, interface, or enum exprected
<dependency>
^
1 error

Any help is appreciated.
0
What is /are the suggested deployment / distribution route(s), once Applets and Webstart will have been retired?
0
Rowby Goren Makes an Impact on Screen and Online
LVL 12
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

What will be the implications / effects of Oracle charging for Java from 2019 for developers, business, enthusiasts and other users?
0
I am trying to capture the event of the file downloading such that the spinning loader can be stopped, however, I tried multiple ways, it's still not working yet. please see my code below:

<script type="text/javascript">
$(document).ready(function(){
    $(":submit").click(function() {   	
        $('#loader').show();
    
/*
* above block of code works, below block does not
*    
        var fileDownloadCheckTimer;
        fileDownloadCheckTimer = window.setInterval(function(){
        var cookieValue = getCookie('fileDownloadToken');
        if(cookieValue == "fileIsReady") {
        	$('#loader').hide();
        	finishDownload();}
        },1000);
        
    });
});



/**
 * Get a cookie
 * @param {String} cname, cookie name
 * @return {String} String, cookie value 
 */
function getCookie(cname) {
    var name = cname + "="; //Create the cookie name variable with cookie name concatenate with = sign
    var cArr = window.document.cookie.split(';'); //Create cookie array by split the cookie by ';'
     
    //Loop through the cookies and return the cooki value if it find the cookie name
    for(var i=0; i<cArr.length; i++) {
        var c = cArr[i].trim();
        //If the name is the cookie string at position 0, we found the cookie and return the cookie value
        if (c.indexOf(name) == 0) {
        	document.getElementById("demo").innerHTML = c.substring(name.length, c.length);;
            return c.substring(name.length, c.length);
        }
    }
     
  

Open in new window

0
I import my XSD file i got parsing error while i have build

 org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'x/request/xxx.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
0
Hi,

I am receiving an error with JAVA could not find java se runtime environment. I used revo unintaller to remove it and from the registry. I re-installed and it still has an error.
Need help ASAP
0
Hi
I'd like to do a vid of some of my expectations for the Last Jedi Star Wars episode 8, and why it was a cluster-dunk and what I would have done.
I will do it in Anime, no pics of Daisy, Adam or John, just Hand Drawn Anime similarity. Macromedia Flash

Will Ryan Johnson and his Disney legal hydralisks track me down and redecorate my house with my intestines?
They sued a day care for having postings that looked similar to Tigger and Eyore for $1000,000 (Mike Meyers, Dr. Evil, ahem)
?
If I change Luke Skywalker to Matthew Herbertson and Ben Kenobi to Bill Genobili?
I read that a cartoon character can be copyrighted, and I'm certain that Disney has copyrighted a 25 year old girl wearing tattered cloth rags, with 3 hair circles on the back of her head - Rey.
Is there any way to do my own version of the story without being murdered, legally? I read that you can not copyright a story.

Thanks
0
I have a Web App in Java running in ubuntu 18.04 and I need to make a URL to the wildfly path to use in a custom file writter.

I use the following code to create the URL object

URL rutaWildfly = new URL("file://opt/wildfly/standalone/deployment/temp.locale");

Open in new window


but when i use that object show me a File not found error, and when i do

System.out.println(rutaWildfly.getPath());

Open in new window


it show: /wildfly/standalone/deployment/temp.locale

why the URL object is removen the /opt/ from the path?

this only happen in linux, if i change the file path to windows it work fine.
0

Java

99K

Solutions

33K

Contributors

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.