Is there anyway to minimize the number of lines of code to achieve the same thing
L1.setFont(new Font("Serief", Font.BOLD, 24));
L2.setFont(new Font("Serief", Font.BOLD, 24));
L3.setFont(new Font("Serief", Font.BOLD, 24));
L4.setFont(new Font("Serief", Font.BOLD, 24));
L5.setFont(new Font("Serief", Font.BOLD, 24));
L6.setFont(new Font("Serief", Font.BOLD, 24));
L7.setFont(new Font("Serief", Font.BOLD, 24));
L8.setFont(new Font("Serief", Font.BOLD, 24));
How to Reduce Line Spacing in Word 1 Open File and Select Text As you launch Word, you need to open the respective file that you wish to format. ... 2 Select Text and Approach Scale From the “Home” tab, you need to navigate to the “Paragraph” section and select the option of “Line and Paragraph Spacing” to open ... 3 Set Line Spacing
Although, a faster way to get to the end of line is probably <Esc>A. So, to sum up, the above can be produced by typing System.out.println (foo ("<Esc>A;. For editing paired characters, as opposed to inserting them, see surround.vim. Show activity on this post.
The smallest value for line spacing that is available is 1.0 in the options. You can access the “Line Spacing Options…” present in the list to set a value of your own.
A good IDE (galileo is almost here) will auto close brackets, parentheses, etc, and will intelligently insert a semicolon at the end of the statement too. No need to use arrows at all!
You could do
Font serif = new Font("Serif ", Font.BOLD, 24);
for (JLabel l : new JLabel[] { L1, L2, L3, L4, L5, L6, L7, L8 })
l.setFont(serif);
In Java 8 you could write
Stream.of(L1, L2, L3, L4, L5, L6, L7, L8).forEach(l -> l.setFont(serif));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With