/BookReader-from-chitanka.info

A Graphical program that reads chapters from a text file from chitanka.info

Primary LanguageJavaMIT LicenseMIT

BookReader-from-chitanka.info

A Graphical program that reads a text file from chitanka.info ,splits it into chapters and allows you to pick a chapter to read.


Table of Contents

Installation steps/How to run:

  • Install a newer version of Java, so it can run the program.Here is a link,if needed: https://www.oracle.com/java/technologies/downloads/
  • Create a chitanka.info profile ,if you dont have any. Here is a quick register link. The site is in Bulgarian thought, just to inform you.
  • Download the book you want in txt.zip format.Like the button pointed to in the image below:

image

  • Unzip the txt file wherever you want, from the zip that you have downloaded!
  • Download the jar file somewhere in your computer.
  • Run the jar file using your installed Java and you should be ready to go. When you have to choose a book,pick the text file that you have just unzipped. Enjoy the simple app ,which I really like ,because of my love to the books 💝📚

If you have some problems with the app, you can write to me at my email: kristiian.donchev@abv.bg


Program short explanation

Choose Book operation

A File Chooser Dialog opens up to choose the file you want to read.You can only open files with .txt extension.

When a correct text file is opened(from chitanka.info ,althought it is possible to recognize other text files as valid also),it prints the author`s name and the name of the book:

image

Load Chapters operation

If a text file is opened you can load the chapters of the book.The chapters are split by comparing the amount of empty lines and the length of the current line of the text file,and also depending of the first letter of the line.The chapter spliting is not perfect thought and will not always split the chapters as desired ,depending on the book.After a chapter is recognized it`s name and start position in the text is saved in a LinkedHashMap,and after the whole text file is read ,the contents of the LinkedHashMap are printed.

Chapters for Crime and Punishment:

image

Pick Chapter operation

You can pick a chapter to read using an InputDialog.You need to write the number of the chapter ,depending of the position in the LinkedHashMap.I use the getChapter method to see if this chapter exists in the LinkedHashMap ,and when it does, we print its information. I also use the splitLine method to shorten the length of the line,for better readability.

Part from Chapter II:

image

Simply used to get the Next or the Previous Chapter ,compared to the current chapter loaded for reading.This is what we get,if we try to get the previous chapter of the first one:

image

Edit Menu Bar Options

New Menu

Currently it contains only the option to open a new book.It uses the same operation as the "Choose Book" button.

Edit Menu

You have the option to change the color of the background and the color of the text!This is made using the JColorChooser Dialog.

Background changed to Yellow and text to Red:

image

You can also change the maximum width of every line(that is the maximum amount of words)for more enjoyable reading experience, using the "Change Line Width" Item.

Chapter with line width of 10:

image

File Menu

You get the options to Load the Chapters,Pick the Chapter and get the Previous or Next Chapter(the same operations from the buttons) in this menu aswell. There is also an option to print the whole book,if you want to do that.You get a confirmation dialog at first to confirm that you really want to do this(because it can be kinda slow).

image

Exit Menu

Used to exit the program.It comes with a confirm dialog:

image


PS:The books are only in Bulgarian ,because the site is made for Bulgarians :) :) :P