Netbeans GUI Designer & Fixed-Size Application Panels

102

Have you tried java full screen mode?

Share:
102
dev_prabh
Author by

dev_prabh

Updated on June 04, 2022

Comments

  • dev_prabh
    dev_prabh almost 2 years

    I'm writing a code which returns each item in a list in "pretty" order. I'm trying to do this without using any built in modules or methods. THIS IS NOT A ASSIGNMENT, as I am just practicing and improving my coding techniques. The problem I'm having is that the function is returning just one single item and not every element in the list. I am separating each item in the list by the new line character. If the list has a nested list, I'm going to indent the items in the nested list by 2 spaces. Any help would be appreciated :)

    def pretty_print(item_list, indentation = ""):
    
            if len(item_list) == 0:
                return " "
    
            for items in item_list:
    
                if isinstance(items, list):
                    return pretty_print(items, indentation = "  ")
    
            return (items + '\n')
    
    • nouseforname
      nouseforname almost 10 years
      It only returns the first value cause of the return, which ends the method call. It also would work only for one level nested. I think it would be better to print directly and not return
  • Admin
    Admin over 15 years
    This did not work. The primary problem (I'm guessing) is that updateUI() does not resolve to the base class (FrameView), nor can I call it upon the top-level frame returned by getFrame(), upon which I exercised the re-size. The size is set according to the debugger, it just has no impact.
  • Admin
    Admin over 15 years
    Thanks; this looks promising. I have it working on my local machine; now I just have to see if the touchscreen system supports it. Seems like it should...
  • Admin
    Admin over 15 years
    Well, it happens no matter the size of the panel (e.g. smaller or larger). It seems related to the outer JFrame size being set by some default resource, and wanting to resize based upon the widgets that I add. So, if it only has one button, it wants to be small, more larger, etc.
  • Admin
    Admin over 15 years
    Note that this happens on my dev box, so isn't related to the touchscreen. Happens there, too, but it's not directly related to the touchscreen.
  • dev_prabh
    dev_prabh almost 10 years
    The first element of a list is still indented, I am trying to indent only when a nested list is found, can we change the level of indentation in the recursive function to make it work?