打开IntelliJ IDEA的设置。在Windows上,可以通过点击菜单栏上的"File"并选择"Settings"来打开设置。在macOS上,可以通过点击菜单栏上的"IntelliJ IDEA"并选择"Preferences"来打开设置。在左侧的导航栏中,找到"Editor"并展开。然后,选择"Code Style"。在右侧的面板中,选择"Java"并点击"Manage"按钮。在弹出的窗口中,选择"Braces placement"选项卡。然后,在"Control statements"部分中,将"If"和"Else"的花括号设置为"At the beginning of the line"。点击"OK"按钮保存设置。
点击"OK"按钮保存设置。