Posts

Showing posts from 2019

Drawing Simple Pie Chart

Image
To draw pie chart with 5 sectors. The program calculates the total of all the input given by user and find the angle in degrees to draw each sectors. When the program first loads, chart based on default values is painted by the program. User can edit the values in the text field and presses draw button to redraw the chart. Each time the draw button is pressed, new set of angle is calculated and repainted. I have attached the the sources for this program. It is simple and needs upgrades. Pie.java This class executed the program and initializes the components JTextField and JPanel to draw the chart. package coolApp.graphics; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Pie { JTextField a,b,c,d,e; JButton btnDraw; double total; JPanel contentPane; Pie(){ JFrame frame = new JFrame("Pie - CoolApps"); frame.setSize(500,500); contentPane = new JPanel(); contentPane.setLayout(new BorderLayout()); frame

Bootstrap 4

Image
Bootstrap provides CSS classes to style your webpages on the go. This saves a lot of time building web page. Before start  we need to  either download the bootstrap and include them in project or refer to bootstrap CDN. Copy and paste following, that links to bootstrap.min.css beta version 4.2 (latest version as of 5 Jan 2019) <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"> Also copy and paste following javaScript <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" ></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"></script> Template The template showing where to place the link to bootstrap CSS and javascripts. <!doctype html> <html lang="en"&

Popular posts from this blog

Drawing Simple Pie Chart

VB.net connecting to SQL Server

VB.net