[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

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
JavaScript Best Practices
LVL 12
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

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
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
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 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
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
CompTIA Cloud+
LVL 12
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

I have a java program which will connect to DB and write into an excel sheet.

Now I would like to make each sheet in workbook as a table and print in outlook and sent via mail also attaching the mail excel sheet using java program.

Any thoughts
0
Hi All,

How to copy some rows of data from excel sheet to new excel sheet in mac using java and if possible throw mail with the attachment of new excel sheet?

Note: Mac office 2011

 Thanks.
0
Hello Experts!

I need your assistance with an issue concerning Java Encryption. What I am trying to do is to get the BlowFish method to function in the class file so that it can run, and output a following in Java:

Wil Wheaton is my hero!

cux,ctqm€{z,u,y…,tq~{-

Wil Wheaton is my hero!

 
mycleverpassword

mxyschlmezvievrppeaysisvwcoorydc

mycleverpassword

What i'm looking for is output for the cleverpassword part but running into issues with cannot use non-static method, symbol, and does not over-ride abstract method. The method that I am using is implementing to the interface Encryptable for both files, excluding the driver and the Encryptable file itself. The Encrypt file is an Interface class and is implemented in the other two class files Secret and Password. The problem is the password file and the driver file.




Your help(s) is most appreciated.
0
I have problem with this issue related to liferay...

2018-10-03 13:06:18.494 INFO  [http-nio-8080-exec-23][UserProfilePortlet:195] null
java.lang.ClassCastException: com.sun.proxy.$Proxy1003 cannot be cast to org.aspire.tipsonsdeals.service.NotifiesLocalService
      at org.aspire.tipsonsdeals.service.NotifiesLocalServiceUtil.getService(NotifiesLocalServiceUtil.java:253)
      at org.aspire.tipsonsdeals.service.NotifiesLocalServiceUtil.createNotifies(NotifiesLocalServiceUtil.java:198)
      at org.aspire.tipsonsdeals.userprofile.portlet.UserProfilePortlet.updateUser(UserProfilePortlet.java:179)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.liferay.portal.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:189)
      at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:418)
      at com.liferay.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:97)
      at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:260)
      at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:77)
      at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:50)
      at …
0
I am trying to stop Java from updating on all computers on a network.

Using group policies I pushed out the registry settings
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy]
"EnableJavaUpdate"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy]
"EnableJavaUpdate"=dword:0

I blocked computers from getting to java.com, java.sun.com and oracle.com

Java still updates. In event logs it shows - Beginning a Windows Installer transaction: C:\WINDOWS\SysWOW64\config\systemprofile\AppData\LocalLow\Oracle\Java\jre1.8.0_181\jre1.8.0_181.msi.

How can I stop java updates?
0
i have an jQuery with html

    <input type="checkbox" name="<portlet:namespace/>push" id="pushnotifications" value="1" checked="checked" />
                           push notifications<br> <br>
                           
In this input text i want to add jquery for changing value after clicked how can i got it?
0
Encountered Error as below on tomcat v9 server post deploying WS and trying to extract the response in SOAP UI

[/services/flasht] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
02-Oct-2018 15:43:01.331 SEVERE [main] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/management] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
02-Oct-2018 15:43:01.331 SEVERE [main] org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods For security constraints with URL pattern [/Response] only the HTTP methods [POST GET] are covered. All other methods are uncovered.
02-Oct-2018 15:43:28.901 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
02-Oct-2018 15:43:28.901 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
02-Oct-2018 15:43:28.904 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@461270d7')
02-Oct-2018 15:47:57.945 SEVERE [http-nio-8080-exec-2] org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable
 java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;I)V
      at com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess(AnnotationScannerListener.java:136)
      at …
0
hi how can i display the top ten record based on the value seected in menu is oracle form 11g
https://drive.google.com/open?id=1oYWbm5Oeb8mV71VWaNtaV8-Y_X95n0PM sample is hear
0
I  am working on handheld Bluetooth weighting machine  
I got problem in Bluetooth socket connection  after paired device which  throw following  error
java.io.IOException: read failed, socket might closed or timeout, read ret: -1

Please refer below code
   private BluetoothSocket createBluetoothSocket(BluetoothDevice device) throws IOException {
        return  device.createRfcommSocketToServiceRecord(BTMODULEUUID);
        //creates secure outgoing connection with BT device using UUID
    }

new Thread()
            {
                public void run() {
                    boolean fail = false;

                    BluetoothDevice device = mBTAdapter.getRemoteDevice(address);

                    try {
                        mBTSocket = createBluetoothSocket(device);
                    } catch (IOException e) {
                        fail = true;
                        Toast.makeText(getBaseContext(), "Socket creation failed", Toast.LENGTH_SHORT).show();
                    }
                    // Establish the Bluetooth socket connection.
                    try {
                        mBTSocket.connect();
                    } catch (IOException e) {
                        try {
                            fail = true;
                            mBTSocket.close();
                            mHandler.obtainMessage(CONNECTING_STATUS, -1, -1)
                                    .sendToTarget();
                        } catch 

Open in new window

0
Introduction to Web Design
LVL 12
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

hi am downloading the file using webutil how can i set the context to ASCII or Text when i download the file in my window is puting everything in one line am in oracle form 11gR2  the application is running in solaris this is what is happening when i download the file https://www.editpadpro.com/tricklinebreak.html i what to do this in my code https://community.oracle.com/thread/2370244
0
Hello Experts at Experts Exchange:

I'm working on an assignment that I need clarification and help upon. The constriction is that there is no constructor in the superclass, and the super-class cannot be modified.  The Assignment is supposed to output something similar to following below. The first two questions asked can change because they are based on user input:

How many Essay questions are in the course? 10

How many Essay questions did the student miss? 4

Each question counts 10.0points.

The Grammer Score: 18.0

The Spelling Score: 12.0

The Correct Length Score: 12.0

The Content Score: 18.0

The exam score is 60.0

The exam grade is D

The constriction is that there is no constructor in the super class, and the super-class cannot be modified. The problem that I am currently having is setting up the arithmetic value(s) to provide accurate result.

Here is the code so far:

-Base Class-
public class GradeActivity
{
	private double score;

	public void setScore(double s)
	{
		score = s;
	}
	public double getScore()
	{
		return score;
	}
	public char getGrade()
	{
		char letterGrade;
		if(score >= 90)
			letterGrade = 'A';
		else if(score >= 80)
			letterGrade = 'B';
		else if(score >= 70)
			letterGrade = 'C';
		else if(score >= 60)
			letterGrade = 'D';
		else
			letterGrade = 'F';
		return letterGrade;
	}
}

Open in new window


The driver and sub class is below
DriverClass.javaEssay.java
0
hello,
i've an error appeared after i installed vmware vrealize business for cloud (7.5.0.23646-10043545) but i get this error in the attach. i also have vmware vrealize operation V (Version 6.6.1.6163035 Build 6163035), so how can i fix it?
Capture.JPG
0
qry:            
select txnCount,currency,amount,days from test where country='IN' AND ROWNUM<=5;

IT MAY FETCH MAX 5 RECORDS
SOME TIME 1 or 2 or 3....
if the rocords count is less than 5 i have set val as NA
EACH COLUMN I NEED TO FETCH VALUES AND SET INTO LIST THEN NEED TO CONVERT IT AS STRING

LET SEE if the above qry fect 3 records
i want to see txnCount column as "23,34,56,NA,NA"
OUTPUT
String txnCount-->"23,34,56,NA,NA"

similary for the rest of the columns as well

i have written below code is there any better approach?

ResultSet rs = st.executeQuery(Query());
		List<String> txnCount = new ArrayList<String>();
		List<String> currency = new ArrayList<String>();
		List<String> docAmt = new ArrayList<String>();
		List<String> avgDays = new ArrayList<String>();
		
		
		System.out.println("size " + rs.getFetchSize());
		while (rs.next()){
			txnCount.add(rs.getString(1));
			currency.add(rs.getString(2));
			docAmt.add(rs.getString(3));
			avgDays.add(rs.getString(4));
			year = rs.getString(5);
		}
		System.out.println("txn sisss "+txnCount.size());
		System.out.println(5-txnCount.size());
		int size1 = 5-(txnCount.size());
		for(int i=0;i<size1;i++){
			txnCount.add("NA");
		}
		int size2 = 5-(currency.size());
		for(int i=0;i<size2;i++){
			currency.add("NA");
		}
		int size3 = 5-(docAmt.size());
		for(int i=0;i<size3;i++){
			docAmt.add("NA");
		}
		int size4 = 5-(avgDays.size());
		for(int i=0;i<size4;i++){
			avgDays.add("NA");
		}
		String txnCnt= 

Open in new window

0
Hello

This is Azizah Alqahtani

I just sent you email like this bellow and you response to give you the python code ..


Could you please help me to solve this problem,

I have to convert a python code to a Java code

Or rewrite the code with the same idea ?


The code is about one type of substitution cipher ?

If you can , I will send you the assignment page and my friend’s answer in python..


Regards..
Assignment1Python.zip
0
I'm trying to get an example of java3d working in eclipse and I get the error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: javax.media.j3d.MasterControl.getAWT()J
errors out at SimpleUniverse universe = new SimpleUniverse();

Does anyone have j3d working with java 8?
external_libs.jpg
java3d_1.java
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.