Created
January 12, 2017 14:53
-
-
Save chalos/c484f2dbffdea50c8b28cf5425870778 to your computer and use it in GitHub Desktop.
Accessing package and protected class members
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package java.awt | |
public class AwtHelper { | |
public static Component getChild(BorderLayout layout, String key) { | |
Component result = null; | |
if(key == BorderLayout.NORTH) result = layout.north; | |
else if(key == BorderLayout.SOUTH) result = layout.south; | |
else if(key == BorderLayout.WEST) result = layout.west; | |
else if(key == BorderLayout.EAST) result = layout.east; | |
else if(key == BorderLayout.CENTER) result = layout.center; | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment