Posts

Showing posts from March, 2022

Random Class in Java

Image
    This week I wanted to keep improving my Java skills. I continued my Udemy course by John Purcell and watched his lecture on utilizing random class on Java. In his lesson, he utilized the the random class by creating Hangman in Eclipse but I wanted to try and use the random class with my own code from scratch. I figured the best way to learn the random class and to keep it simple would be to create a dice via Java.      It is a fairly simple project but it let me try something new and let me experiment with the random class and importing different items in Java. I had to begin the code by telling Java that I want the object DiceRoll to be Random after that I needed to initialize x, which could be labeled anything, and to have it be within the range of 1 to 6. If I were to change the line int x = DiceRoll.nextInt(6) + 1; <-- to int x = DiceRoll.nextInt(10) + 5 It would make the dice roll start at 5 instead of 1 and make the dice roll any number from 5 to 15...

My First GUI

Image
 This week I decided to take a break from working on my application to focus on developing my coding skills. I took up on creating a GUI or graphical user interface. I believe this to be one of the more important skills that I can learn as a software engineer. I built my code within EclipseIDE.  As I started building my code, I used a JFrame to build the initial size of the window I wanted to show. I also added  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setTitle("GUI"); frame.pack(); frame.setVisible(true); and this allowed me to set the window to fully close when exited, name the window, made the window match a certain size, and make the window visible. After that, I wanted to add something simple to give the window a purpose so I added the code to create a button. The button didn't do anything at first so I thought what would be something simple but fun to do. I made the window a bit larger to accommodate more text and a button. After that, I ...

Next Steps in Creating my Application

      With the direction that I want to go with my application, I figured iOS or Apple's software is the best way to go due to uniformity with it's software and according to an article by Statista, around 47% of smartphone users in the US use an iPhone. To me, this is a good start to building because I will only have to focus on coding and designing the UI for one operating system instead of Androids' numerous operating systems. After deciding what operating system I wanted to develop the application on, I needed to find and research what IDE to use. That was simple for me because after doing a quick google search, I found out that Xcode is that Apple actually supports directly on their developer website and it is also freeware so I won't have to invest a large sum of money to get started.     Next, I had to figure out what are the next steps to being able to create the app. According to the book "Learning iPhone Programming: From Xcode to App Store", they rec...