Skip to main content

All Questions

Tagged with
1 vote
0 answers
379 views

Global exception handler that just log and go on with the exception

I need to create a global exception handler just to log what data sent caused the exception with some other little things and, after this, go on with the normal exception handling on my application. I ...
Alefi Cunha's user avatar
0 votes
2 answers
785 views

Android create global variable which holds its state

I have an application in that whenever the internet connectivity changes , I need to make some variables in another activities unclickable. Since internet connectivity might change in the first ...
Saneen K P's user avatar
-3 votes
1 answer
513 views

How do I run a method Boolean: checkUserName(); This method ensures that any username contains an under score (_) and is no more than 5 characters [closed]

This is the code, that I have so far. It does not run. The method does not seem to be taking the input string and processing it. import java.util.Scanner; // Import the Scanner class import java.util....
Imraan Jacobs's user avatar
0 votes
1 answer
121 views

Is there a way to keep a class synchronized between two classes that are using it?

Imagine that there are two jFrames from a view that use methods from a Controller class, the Controller is declared on both jFrames as it follows: public Controller c = new Controller(); I need that ...
cam4076056's user avatar
0 votes
2 answers
65 views

NullPointerException in static array [closed]

I want to access nodes[i] globally in every method, where am I wrong? class file{ private static java.io.File file; private static BufferedReader reader; private static int[] nodes; ...
user avatar
0 votes
1 answer
93 views

How to access local variable by storing it to class variable(global) in java android

Fragment A The problem here is whenever I call passitem(),passqty(),passamt(),passtot() i get the value which is declared at the time of intialization.i.e,int totalp = 0; String itemp = "", ...
APOORVA SINHA's user avatar
1 vote
0 answers
66 views

How to suppress F keys of other aplications

I created a Java application that uses GlobalScreen to addNativeKeyListener. (jnativehook library) When i press F5 it executes a code. Problem is that if i give focus to other applications it also ...
FilipDolezal's user avatar
1 vote
2 answers
1k views

Using EJS without NodeJS

I figured that the latest build release would allow me to use ejs globally without using node so I tried doing so. Though, when I try to use ejs.renderFile(params...), i get the error: TypeError: ...
theDumbProgrammer's user avatar
0 votes
1 answer
148 views

Can't add values in an arraylist?

Why is arrayList printing 2 times in this javafx controller code? Example 1: List<Compute> list = new ArrayList<>(); // declared as global @FXML public void clickSubmit() { int hr ...
ratRiot01's user avatar
0 votes
1 answer
383 views

How to set Global variable from other class method variable?

I want to set value as global variable, that needs to access any class file. Country.java: public class Country { public String getMobileCode() throws SQLException, Exception{ /* MySQL ...
uday's user avatar
  • 183
0 votes
1 answer
66 views

How can I not use a global variable in this embedded program?

I believe we have an edge case in our firm, which prevents me from entering the "never use global variables camp". We need to write an embedded application which works in our box, that pulls medical ...
Onat Korucu's user avatar
  • 1,026
1 vote
2 answers
80 views

whlie loop never exiting even though variable updated

I have created a nested class that extends the AsyncTask to extract data from a database. When the extraction is completed, it sets a global variable ("notificationsExtracted") to true, to say that ...
Shamusvw's user avatar
0 votes
1 answer
29 views

How to get a global reference of an array without knowing its size beforehand?

I'm stuck in a situation, where I need a global reference of an array but I get to know it's size only after the user enters it. I've tried to make another class and do something, but still the ...
user avatar
1 vote
0 answers
231 views

Key mapping on keyboard using native listener

I am trying to code a small module that allows user to enter a key by others keys (Key mapping) using NativeKeyListener. Mapping function is working fine but output always has 2 keys value (one is the ...
An Nguyen's user avatar
  • 296
0 votes
1 answer
91 views

Cannot change global variable

item1 is a global variable in a same class, but I cannot change it even after using this function. if I use item1, it says item1 is null public void getItemFromServer(String id){ retrofit=new ...
Royell's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
10