Code Monkey home page Code Monkey logo

bookreader-from-chitanka.info's Introduction

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: [email protected]


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

bookreader-from-chitanka.info's People

Contributors

cavani99 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.