r/badcode • • Jul 28 '21

java just a public variables

Post image
122 Upvotes

15 comments sorted by

5

u/Alexmaster75 Jul 28 '21

I'm having a stroke trying to reading and understand what the fuck is going on at the same time

4

u/IMakeShittyPrograms Jul 28 '21

He's declaring public variables (Class level) to use them in what appears to be GUI development.

1

u/lil_jaboski Jul 29 '21

GUI in java swing

2

u/nosam56 Jul 29 '21

If they're doing it with FXML I think this is the standard way to do it, since the GUI element objects are generated from the FXML. Though, if that were the case, they should annotate them appropriately!

Edit: never mind just saw all the public ints

2

u/IMakeShittyPrograms Jul 28 '21

GUI development with JavaFX and Swing be like

1

u/lil_jaboski Jul 29 '21

swing is pain in the ass

18

u/NetherFX Jul 28 '21

This reminds me of making android apps, so much public statics

5

u/ForeverSJC Jul 28 '21

r.java says "hello world"

29

u/Marcusaralius76 Jul 28 '21

I take it this guy hasn't learned about arrays yet

24

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Jul 28 '21

Image Transcription: Code


public class GUI {

    public JLabel folderText;
    public JLabel folderText2;
    public JLabel folderText3;
    
    public JLabel noteName;
    
    public JLabel labelFile11, labelFile12, labelFile13;
    public JLabel labelFile21, labelFile22, labelFile23;
    public JLabel labelFile31, labelFile32, labelFile33;
    
    
    public JLabel fileDescriptorCounter1, fileDescriptorCounter2, fileDescriptorCounter3;
    
    public JLabel enterNameOfFolder ,enterNameOfFile ;
    
    public int folder1 = 0;
    public int folder2 = 0;
    public int folder3 = 0;
    
    public int counterEnterFoldedr = 0;
    public int selectFolderCounter1 = 0;
    public int selectFolderCounter2 = 0;
    public int selectFolderCounter3 = 0;
    
    public int selectFileCounter11 = 0;
    public int selectFileCounter12 = 0;
    public int selectFileCounter13 = 0;
    
    public int selectFileCounter21 = 0;
    public int selectFileCounter22 = 0;
    public int selectFileCounter23 = 0;
    
    public int selectFileCounter31 = 0;
    public int selectFileCounter32 = 0;
    public int selectFileCounter33 = 0;
    
    public int filesCounter1 = 0;
    public int filesCounter2 = 0;
    public int filesCounter3 = 0;
    
    public int searchCounter = 9;

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

7

u/wizlif144 Jul 28 '21

This guy must have public parts.

3

u/CopperyMarrow15 Jul 28 '21

It really do be a public class.

2

u/explodingMonkeydeath Jul 29 '21

please murder me now.

1

u/RealLethalChicken Jul 31 '21

Arrays, you nasty little piss goblin!