Question: How would I go about reading the first 5 lines from a text file in java using a buffered Reader or Scanner? Here is my code

```
        final int assumedLineLength = 16;

    File file = new File("src/hw7p1/Acronyms.txt");
     HashMap<String, String> hashMap = new HashMap<String, String>((int)(file.length() / assumedLineLength) * 2);
    BufferedReader reader = null;
    int linecount = 0 ;
    String eachLine = null;
    try {
    reader = new BufferedReader(new FileReader(file));

    for ( eachLine = reader.readLine(); 
            eachLine != null; 
            eachLine = reader.readLine()) {
        hashMap.put(eachLine, " ");
        linecount++; int i = 0;

    }

    TreeMap<String, String> sorted = new TreeMap<>(hashMap);

     Set<Entry<String, String>> sortings = sorted.entrySet();

    for(Entry<String, String> sort : sortings){ 
        System.out.println(sort.getKey() + " " + sort.getValue());

    }

     }catch (IOException e) {
         e.printStackTrace();
     }

```

}
It prints out the text file, but what I am trying to do is just to get it to print out the first 5 lines. Any help would be appreciated.

Answer: 
Use the `style.width` property before you append the button element to the body, like so : 

```js
var buttonShort = document.createElement("button");
buttonShort.innerHTML = "Generate Short Password";

var body = document.getElementsByTagName("body")[0];

buttonShort.style.width = '200px'; // setting the width to 200px
buttonShort.style.height = '200px'; // setting the height to 200px
buttonShort.style.background = 'teal'; // setting the background color to teal
buttonShort.style.color = 'white'; // setting the color to white
buttonShort.style.fontSize = '20px'; // setting the font size to 20px

body.appendChild(buttonShort);

buttonShort.addEventListener("click", function() {
  var newWindow = window.open();
  newWindow.document.write("The generated Password is: '" + short() + "'");
  newWindow.focus();
});
```

all the other CSS properties are accessible through the `style` object (width, height, color, ...etc)

> 
> **NOTE:** beware of properties like `font-size` you cannot use the `-` as
>  an object key so the way you would go about doing that is by
>  `camelCasing` it like so `fontSize`.
> 
> 
>
How about the following code?

```
var cssString = "{padding: 15px 20px; color: #F00;}";
buttonShort.style.cssText = cssString;

```