Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

eclipse formatting

Posted on 2016-11-05
6
Medium Priority
?
165 Views
Last Modified: 2016-11-14
Hi,
In eclipse when i write code and to format i press Control+Shift+F keys together. it is formatting as attached on contl1 attachment where
for(){//here i want { in next line 

Open in new window


But i want formatting as in attachment contl2 so that
 { is in next line which is same vertical line as closing } 

Open in new window

so that i understand easily where control block starting and ending. how to achieve this custom formatting in eclipse please advise
contl1.png
contl2.png
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 1000 total points
ID: 41875922
Hi,

I found that code in both the images are of same formatting.

However, you can control the formatting through the option under Window->Preferences->Java->Code Style->Formatter, then click the "Edit.." button.

Refer : http://www.wikihow.com/Change-the-Default-Format-Settings-in-Eclipse
0
 
LVL 36

Assisted Solution

by:mccarl
mccarl earned 1000 total points
ID: 41876447
And to add to Amit's answer, because it can be a little hard to find. Once, you click the Edit button as above, then go to the "Braces" tab and change all the options from "Same line" to... "Next line"
0
 
LVL 7

Author Comment

by:gudii9
ID: 41876494
oops i missed right screenshot. I attached actual screenshot on how i want my formatting. If you see line 8 you see there is no { instead it moved to line 9 which makes more appealing to my eyes. please advise
pyramidFormat.png
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 36

Expert Comment

by:mccarl
ID: 41876578
please advise

We already did!! Did you miss the rest of Amit's post or my post?
0
 
LVL 7

Author Comment

by:gudii9
ID: 41879313
I found that code in both the images are of same formatting.

However, you can control the formatting through the option under Window->Preferences->Java->Code Style->Formatter, then click the "Edit.." button.

Refer : http://www.wikihow.com/Change-the-Default-Format-Settings-in-Eclipse

after changing if i want go back to original default how to do that?
0
 
LVL 36

Expert Comment

by:mccarl
ID: 41880479
Just change it back
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question