All Questions
Tagged with visibility java
451
questions
0
votes
2
answers
63
views
Component not visible after using "setVisible(true)" on it and its parent
I've got a Java 8 app with a couple of JTextFields and a JButton to log into a database and a JTextArea inside a JScrollPane to display errors. Both the textarea and the scrollpane have to be hidden (...
0
votes
0
answers
5
views
How can I change the visibility of a relativelayout in RecyclerView inside Another activity
How can I change the visibility of this relativelayout progressBarRelativeLayout in this RecyclerViewAdopter inside another activity
package com.google.gemini;
import android.content.Context;
...
15
votes
2
answers
15k
views
How can I fix warning that Class 'Shape' is exposed outside its defined visibility scope?
I made function 'warn' in line 17 whose parameter is enum Shape. Why is it warning about visibility scope and how can I fix it?
import java.util.Scanner;
public class AreaCalculator {
enum Shape ...
0
votes
1
answer
114
views
How do I use a JDK class that isn't visible to me?
I am new to Java so please bear with me.
I am trying to use the JDK class "com.sun.tools.example.debug.expr.ExpressionParser". When I compile my code, I get the following error: "...
0
votes
1
answer
58
views
Writing to a volatile field and reading another volatile field: Is the happens-before-rule valid?
Question: Is this statement true: „A write to a volatile field happens-before every subsequent read of that or another volatile field.“
On How to understand happens-before consistent I found the ...
0
votes
0
answers
148
views
What are the visibility rules for package com.sun.tools.javac.code in oracle open jdk version 20?
I am writing a database management program in java in maven in intellij IDEA. For now, the code is only connecting me to the database in MySQL. The code itself has no errors. However, upon running it, ...
3
votes
1
answer
128
views
Can BlockingQueue make MemorySegment visible for multiple threads?
I am using JDK20's FFI, and I need to pass a Object to a BlockingQueue to shared it from one thread to another. The Object contains several MemorySegment field, which belongs to Arena.openShared(). ...
1
vote
1
answer
299
views
Do inherited methods use the visibility, methods and attributes of the superclass or subclass?
What I assume is that an inherited method will, by standard, use the methods and attributes of the class whose object is used to execute that method.
Here's an example for my question, it's from a ...
2
votes
1
answer
536
views
Get all visible windows with JNA
I am programming an overlay in Java showing information for multiple windows.
I need it to follow the window that it is tracking, and to do this I regularly take information about the current windows ...
0
votes
1
answer
228
views
'void android.widget.LinearLayout.setVisibility(int)' on a null object reference when i want to display a LinearLayout
I have a problem with a button that modifies the visibility of a LinearLayout
I always get the error
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.LinearLayout....
3
votes
2
answers
923
views
How to hide the VS Code bar with file name, breadcrumbs, and action buttons?
I'd like to hide the toolbar visible in the screenshot:
I can hide the menu bar by going into full-screen mode, but I haven't been able to get rid of the bar with the file name, run button, split, ...
1
vote
2
answers
378
views
Android Studio If-statement make TextView visible if invisible and invisible if visible
I am trying to make a textView invisible when pressing a button. But, if the textView is already invisible I want it to become visible.
Currently I am trying sonething like this:
public void ...
0
votes
0
answers
49
views
How can I use a updated list in other if-else block?
I am a beginner and working with IntelijIDEA configurations first time.
Conditions of a task is:
When starting the program with the -c parameter, the program should add a person with the given ...
0
votes
2
answers
59
views
How to change location of Textview
I have a Linear Layout inside of Constraint Layout. The cardview visibility changes depending on the data. How to align start textview1 and textview2 if cardview visibility is invisible ?
-4
votes
1
answer
55
views
Which is better answer about security? [closed]
We have the next source of a Java class and some possibilities to secure its variables:
public class Foo {
public static String ALPHA = "alpha";
protected String beta = "beta&...