ButtonSize manager
This Fuction will manage the size of the Button same if there is any text, As it will check the text of each button and make the width of the item as of highest length text private void ButtonSizemanager (){ Button[] buttons = { option1 , option2 , option3 , option4 }; // Replace these with your actual buttons // Find the button with the longest text Button buttonWithLongestText = buttons[ 0 ]; // Start with the first button for (Button button : buttons) { if (button.getText().length() > buttonWithLongestText.getText().length()) { buttonWithLongestText = button; } } // Get the width and height of the button with the longest text int maxWidth = buttonWithLongestText.getWidth(); int maxHeight = buttonWithLongestText.getHeight(); // Set the width and height to other buttons for (Button button : buttons) { button.setWidth(maxWidth); button.setHeight(maxH...