[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

Using jsp sessions HOW TO SWITCH / (SWAP) THE LEFT AND RIGHT BUTTON  WHEN THE CLICK BUTTON IS PRESSED.?  refer screenshot. need to swich tthe button on click of the click button.
0
Starting with Angular 5
LVL 12
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

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
i'm very new to android... but i have a lot experience in programming with PHP(9+ years) and quite a lot but no so much in Java (~3+years)
i just want to create an app that connects to an api (with login and logout), but before that i have to make it offline, i mean using SQLite in order to READ the data (login)
i'm facing a problem that i cannot access to the database sqlite which i already create using sqllite browser using the folloing line
SQLiteDatabase mydatabase = openOrCreateDatabase("test.db", MODE_PRIVATE, null);

Open in new window

i cannot read the user and my app just get out alone
0
Hi All,

Is it possible to read "bolditalic" font style using docx4j in java?
like we do getB() and getI().

If we are using both options it's not getting the above property.
Please help.

Thanks.
0
I have successfully packaged OpenCV library in android project using Import Module. But I get the error "Package Not Found - OpenCV Manager package not found, try to install it" What can I do to resolve this problem.
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 converted a java program to VB program.

After converting, When I am trying to run the program, I am getting some errors. Please suggest if any help

Imports java.io.File
Imports java.io.FileNotFoundException
Imports java.io.FileOutputStream
Imports java.io.IOException
Imports java.sql.Connection
Imports java.sql.DriverManager
Imports java.sql.ResultSet
Imports java.sql.ResultSetMetaData
Imports java.sql.SQLException
Imports java.sql.Statement
Imports java.text.SimpleDateFormat
Imports java.util.Calendar
Imports java.util.LinkedHashMap
Imports java.util.Map
Imports java.util.Set
Imports java.util.TimeZone
Imports javax.activation.DataHandler
Imports javax.activation.FileDataSource
Imports java.util.Star
Imports javax.mail.Star
Imports javax.mail.internet.Star
Imports javax.activation.Star
Imports javax.mail.Session
Imports javax.mail.Transport
Imports org.apache.poi.hssf.usermodel.HSSFCell
Imports org.apache.poi.hssf.usermodel.HSSFCellStyle
Imports org.apache.poi.hssf.usermodel.HSSFFont
Imports org.apache.poi.hssf.usermodel.HSSFRow
Imports org.apache.poi.hssf.usermodel.HSSFSheet
Imports org.apache.poi.hssf.usermodel.HSSFWorkbook
Imports org.apache.poi.hssf.util.HSSFColor
Imports org.eclipse.swt.SWT
Imports org.eclipse.swt.ole.win32.OLE
Imports org.eclipse.swt.ole.win32.OleAutomation
Imports org.eclipse.swt.ole.win32.OleClientSite
Imports org.eclipse.swt.ole.win32.OleFrame
Imports org.eclipse.swt.ole.win32.Variant
Imports …
0
Exploring SQL Server 2016: Fundamentals
LVL 12
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

How to find SQS header value in a AWS message. we are using a java pojo to access the message and setting the message value. how can we find the message header value.

 can somebody help.

Thank you
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
I'm unable to compile first java program.

javac is not recognized.  Please see attached.
Hello_World_not_compiling.PNG
0
Hi Team,

iam new to Java , I need to write a program which involves a multi threading . I have an input file ,   from this file I need to read data line by line and then after reading a line , I need to write the logic to store in DB .  This line read needs to be split into individual fields and then stored into database.

I know how to read and split the data , bu tthe logic of simultaneously doing the task using thread is what i want help.

Any help with any sample program is really appreciated.
0
I have different applications

1st application Developed using C++ and have a gui menus
2nd appication-  Developed web application
3rd application - Java swing application

1. Need to modify few configuration after login into the above application
2. Need to run few SQL queries on DB which is being used by the application

Which tool would be the best tool to automate ? if no tool is available, how to automate this

How to write a code which executes different operations in different application with one click ???

Thanks,
0
Hello Sirs
I am using serious issues with Charset Encoding in a REST application. I use Spring and the encoding in the bean MessageSource and Tymeleaf resolver  is set to UTF-8.
I get this when I return Json string:
\ufffd replacing special characters like é, or any other letter with accent.
How can I solve this?

Best regards.
0
Experts,

is it good to have a ParseException or try catch   which would be much better way handling...

@CrossOrigin
      @RequestMapping(value = "save/", method = RequestMethod.POST, produces = { "application/json" })
      public Map<String, Object> createCounseling(@RequestBody String counselingData) throws Parse{
            JsonObject CounselingObject = Json.parse(counselingData).asObject();
            HibernateDao<Counseling> workerDao = counselingDaoFactory.getNewDao(Counseling.class);
            Counseling counseling = getCounselingObject(CounselingObject);
            Map<String, Object> counseilingMap = new HashMap<>();
            workerDao.save(counseling);
            counseilingMap.put("status", HttpStatus.OK);
            counseilingMap.put("data", new ArrayList<>());
            return counseilingMap;
      }

Thanks
0
Hey all I am using RFT in order to automate a page on a Pega website page. However, the automation doesn't seem to be able to fire off the change event of the input that I am inserting a string of text into. This input box seems to be located inside an iframe and perhaps this is the reason why its not firing the onchange event when losing focus on that input box?

RFT does use Selenium in their program to interact with the web page.

The html of the input box:

<input 
    data-id="204083727717650" 
    data-ctl="["TextInput"]" 
    id="BBOX" 
    maxlength="15" 
    validationtype="required" 
    value="" 
    name="$PpyWorkPage$pBBOX$pBBOX" 
    class="leftJustifyStyle" 
    data-change="[["refresh", 
                   ["otherSection",
                    "RecordInformation", 
                    "", 
                    "&amp;=", 
                    "", 
                    "BBOXOnChange,",
                    ":event",
                    "",
                    "pyWorkPage.BBOX"
                   ]
                 ]]" 
    type="text">

Open in new window


The Selenium code I have tried is this:

driver.switchTo().frame(driver.findElement(By.name("PegaGadget")));     

WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("BBOX")));
final WebElement BBOXInputBox = driver.findElement(By.id("BBOX"));

BBOXInputBox.click();
BBOXInputBox.click();
Thread.sleep(2000);
BBOXInputBox.sendKeys("204083727717650");
Thread.sleep(2000);
BBOXInputBox.sendKeys(Keys.TAB);
Thread.sleep(2000);
BBOXInputBox.sendKeys(Keys.BACK_SPACE);
Thread.sleep(2000);
BBOXInputBox.sendKeys("1");
Thread.sleep(200);
BBOXInputBox.sendKeys(Keys.TAB);
Thread.sleep(2000);

Actions builder = new Actions(driver);
builder.moveToElement(driver.findElement(By.id("FirstName_U")), 5, 5).click().build().perform();

driver.findElement(By.id("FirstName_U")).sendKeys("something");

Open in new window


And I am trying my best to find this function above in their 30 or so of .js files for any one page.

So someone more knowledgeable than I in the area of this type of coding in JS please set up and let me know what I should be looking for in the .js source code so that I can fire this change event manually within code.

It seems when I click on the text box, input a few letters and then either tab or click on another input box on that same form it fires some type of event/function that populates a label on the page.

What I have been looking for within the .js source code would be a function called refresh(...) or something along the lines of refresh: function(...)... or _refresh: function(...)... but I haven't been able to find anything that resembles the parameters its sending to that function.
0
Need help on two interfaces in Java/ I want to know the difference between
FilenameFilter and FileFilter interfaces in Java. Both have the same accept method , but onlky difference being number of and type of parameter in each interface.
0
OWASP: Threats Fundamentals
LVL 12
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

I'm trying to build with Maven in Eclipse and keep running into this error.

Maven is executing in offline mode. Any artifacts not already in your local [artifact:mvn] repository will be inaccessible.

How do I get it to be in online mode?
0
#1 After running the "setContentView(gameView);" inside the onCreate method of GameActivity.java, does its onResume() method will be run to start the in order to call the resume() method inside TDView.java ?

#2 Inside resume() method in TDView, does it create a thread of itself and run the code under "run" method ?

gameThread = new Thread(this);
gameThread.start();

#3 What the purpose of "join" under pause method of TDView ? Does it remove the current thread after all the codes under method "run" have been executed ?
gameThread.join();
GameActivity.java
TDView.java
0
What conditions could give rise to the following exception please :

java.net.ConnectException: Connection timed out: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
0
i need to upgrade JRE from 1.6 to 1.7.17 on windows server 2008R2 standard 64 bit

can you tell me a genuine web site or steps as to how to go for upgrade.
0
What's the explanation for this not compiling ?

SSLSocketFactory factory = SSLSocketFactory.getDefault();

from, Java in a Nutshell, Flanagan, 5th edition, page 948.

?

Error reads :

: error: incompatible types: SocketFactory cannot be converted
o SSLSocketFactory
0
What's the difference between DoubleProperty and Double in Java ? When should I use DoubleProperty ?

Thx
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.