A portable electronic device including a touch screen and a controller, wherein: the touch screen is configured to receive touch inputs and display windows; and the controller is configured to: control the touch screen to simultaneously display a first window for executing a first application and a second window for executing a second application, wherein a side of the first window and a first side of the second window are displayed to contact with each other with a boundary between the first window and the second window in a split mode, wherein the first application is different from the second application; detect a drag gesture from a first point on the first side of the second window to a second point on a second side of the second window ; and rotate the second window by 90 degrees or 180 degrees in a direction depending on the first side where the drag gesture starts and the second side where the drag gesture ends, while the first window is maintained such that the rotated second window and the maintained first window are displayed to contact with each other with the boundary between the maintained first window and the rotated second window in the split mode. the touch screen is configured to receive touch inputs and display windows; and the controller is configured to: control the touch screen to simultaneously display a first window for executing a first application and a second window for executing a second application, wherein a side of the first window and a first side of the second window are displayed to contact with each other with a boundary between the first window and the second window in a split mode, wherein the first application is different from the second application; detect a drag gesture from a first point on the first side of the second window to a second point on a second side of the second window ; and rotate the second window by 90 degrees or 180 degrees in a direction depending on the first side where the drag gesture starts and the second side where the drag gesture ends, while the first window is maintained such that the rotated second window and the maintained first window are displayed to contact with each other with the boundary between the maintained first window and the rotated second window in the split mode. control the touch screen to simultaneously display a first window for executing a first application and a second window for executing a second application, wherein a side of the first window and a first side of the second window are displayed to contact with each other with a boundary between the first window and the second window in a split mode, wherein the first application is different from the second application; detect a drag gesture from a first point on the first side of the second window to a second point on a second side of the second window ; and rotate the second window by 90 degrees or 180 degrees in a direction depending on the first side where the drag gesture starts and the second side where the drag gesture ends, while the first window is maintained such that the rotated second window and the maintained first window are displayed to contact with each other with the boundary between the maintained first window and the rotated second window in the split mode. <EOS>