All Questions
Tagged with visibility java
451
questions
0
votes
1
answer
99
views
Set a timer for the visibility of a button
This is purely theoretical put let's say once I put a timer for a button to appear only 86400 second later (like 24h), will it the count down continue after the app is shut down ?
Can the user close ...
0
votes
2
answers
65
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 (...
17
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
0
answers
6
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;
...
6
votes
1
answer
670
views
Subclassing sun.* class in same package gives IllegalAccessError
Foreword:
What am I going to show you is WRONG and I'm well aware of how bad I am for breaking encapsulation by doing such foolish thing.
I'm not trying to solve any more general I/O problem. It's ...
3
votes
2
answers
941
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, ...
82
votes
3
answers
11k
views
Why is there no sub-class visibility modifier in Java?
On more than one occasion I have found myself desiring a variable visibility that is not possible in Java. I wanted certain members to be visible within their own class and within any sub-classes, ...
0
votes
1
answer
120
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
151
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, ...
51
votes
9
answers
24k
views
public methods in package-private classes
Does it make a difference to mark methods as public in package-private classes?
class SomePackagePrivateClass
{
void foo(); // package private method
public void bar(); // public ...
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
309
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
553
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 ...
4
votes
2
answers
484
views
Java Memory Visibility and AtomicReference's
Note:: This question has to do with memory visibility and not "public", "private" etc.
Lets say I had the following class:
public class Data {
public final byte[] array;
public final int ...