Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1021989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:23:40+00:00 2026-05-16T11:23:40+00:00

Is the formatting below some kind of convention in Java? I personally found it

  • 0

Is the formatting below some kind of convention in Java? I personally found it more difficult to read, than the second example. Am i alone here? And is there a way to make such a custom formatting in NetBeans when choosing Source -> Format?

public boolean handleEvent(Event e) {
    if (e.target == quit) System.exit(0);
    else if (e.target == parent) {
        // Code here
        // Bug workaround
        }
        catch (IOException ex) { infoarea.setText("I/O Error"); }
        return true;
    }

(second example)

public boolean handleEvent(Event e) 

   {
      if (e.target == quit) System.exit(0);
      else if (e.target == parent) 

          {
            // Code here
            // Bug workaround
          }
      catch (IOException ex) { infoarea.setText("I/O Error"); }
      return true;
   }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:23:41+00:00Added an answer on May 16, 2026 at 11:23 am

    Although the given code doesn’t compile, I assume you are talking about using opening braces on the same line as the class/method/command, as opposed to taking a new line before using them?

    If so, It’s really a totally subjective thing – I personally hate having my braces on a new line; it looks as wrong to me as same line ones do to you. The only important thing is to make sure that if you’re working in a team, you’re all sticking to the same conventions – there’s no real right/wrong for this matter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got some sort of formatting -problem that I cannot understand, a short example
The string formatting concept found in sprintf can be found in almost any language
I have some conditional formatting styles. I don't want to keep creating new rules
I am trying to apply some conditional formatting on a WPF DataGrid.The requirement is
I have installed MacVim but I cannot figure out how to do some formatting
I'm attempting to use boost::format, where my formatting string is the HTML below. I
Take the example classes below. I want to display the customer and two addresses
Im trying to format my textfield for float values. Example: 0.00 for some reason
I'm using exponential formatting to format a decimal number in C#. For example if
Below is some sample code showing ESC/POS commands from Epson, and unfortunately I'm a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.