100 Days Coding Challenge - Day 4/100 [ Reports and Alert Box]

in #bigwaves6 years ago

Hello good evening, guess you had a great day? Hope it was a great one.

Today being the fourth day of my 100 days coding challenge, I encountered a problem in my game building process which I'm still yet to solve, the problem is getting the ball to stop moving when it hits the bottom edge of the screen, but for now I've not been able to work around the code, I'm sure I'll be able to fix that soon.


What did I do today?


image

Today i worked with creating reports and also adding alert box to my UI, for exxample if a new user was saved succesfully, the system should display an alert showing the user that the information has been saved succesfully.

For now I've gotten the alert box to display and information, but before I changed a little about the arrangement, I noticed the Title of the message was biger and more pronounced than the message, so I replaced the message with the title and vice versa, this way the message is presented bolder than the title and the user can easily understand it.

 Alert alert = new Alert(Alert.AlertType.INFORMATION); //This creates a new alert box to display information alone, other choices could be to choose an option and so on.
            alert.setTitle("This is a test alert");
            alert.setHeaderText("This displays the alert test");
            alert.setContentText("System Alert");
            alert.showAndWait();
            
            ```

The above creates and displays the alert, you can add this to your java fx program and see how to fix an alert box in your program.
Here's a screenshot of the alert.

 ![image](https://img.esteem.ws/k8n02crpt2.jpg)

Secondly I created a pdf report from my program using ITextPdf java library. This library is used to create reports of data in an application, in this case I'll be using it to generate reciepts and financial reports since that is the required deliverable for my software.
The report only displays dummy data for now, and has not been completely designed, it just diplays a simple message and I'll be completing both the alert box and the report designs by tommorow.

try{

        Document report = new Document();
        PdfWriter.getInstance(report, new FileOutputStream("Report.pdf"));
        report.open();

        report.add(new Paragraph("This is the report test"));

      report.close();

    }catch(Exception e){

        e.printStackTrace();
    }

The code above creates the report in a pdf file and places it in the folder where the applications files are stored, I'll have to fix a way for the report to open itself after it is created and probably send a print request to the printer itself.
Here's a screenshot of the report created.

 ![image](https://img.esteem.ws/pjuau7c65p.jpg)

So at the end of today, I solved two problems and Have one unsolved... Quite satisfactory....

### <center> Thanks for Stopping by, I remain Official-hord</center>
Sort:  

Thanks for using eSteem!
Your post has been voted as a part of eSteem encouragement program. Keep up the good work! Install Android, iOS Mobile app or Windows, Mac, Linux Surfer app, if you haven't already!
Learn more: https://esteem.app
Join our discord: https://discord.gg/9cdhjc7

Coin Marketplace

STEEM 0.31
TRX 0.12
JST 0.033
BTC 64485.37
ETH 3156.53
USDT 1.00
SBD 4.05