Advertisement
FALSkills

Untitled

Oct 15th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public static boolean resizeSplitPane(double gameWindowPercentage) {
  2. JFrame tribotFrame = findTRiBotFrame();
  3. if (tribotFrame == null) {
  4. General.println("Error, could not find TRiBot Frame. Cannot resize debug.");
  5. return false;
  6. }
  7. if (gameWindowPercentage < 0 || gameWindowPercentage > 1) {
  8. General.println("Error, percentage argument is not between 0 and 1.");
  9. }
  10. JSplitPane tribotSplit = (JSplitPane) tribotFrame.getContentPane().getComponent(0);
  11. tribotSplit.setDividerLocation(gameWindowPercentage);
  12. return true;
  13. }
  14.  
  15. public static JFrame findTRiBotFrame(){
  16. for(Frame frame:JFrame.getFrames()){
  17. if(frame.getTitle().contains("TRiBot Old-School")){
  18. return (JFrame) frame;
  19. }
  20. }
  21. return null;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement