08-03-2016, 08:07 PM
thanks for sharing....have a nice day.Are you looking for implementation of banker algorithm with gui ?
Type your request / requirement / comment about implementation of banker algorithm with gui in to the right box for getting free material and support from us/dedicated premium members...
Its a free service...==>
==>
==>
==>
Dont forget to save this page.>!
Scroll down to see Save button...!
Font
Text Size
thanks for sharing....have a nice day
Post Options: Signature: include your signature. (registered users only)
Disable Smilies: disable smilies from showing in this post.
Thread Subscription:
Specify the type of email notification and thread subscription you'd like to have to this thread. (Registered users only) Do not subscribe to this thread
Subscribe without receiving email notification of new replies
Subscribe and receive email notification of new replies
Image Verification
Posts: 8,059
Threads: 1
Joined: Mar 2014
implementation of banker algorithm with gui
There are two major parts in the animation window. The top panel consists of four little windows, indicating how many resources of each kind are left. Here different resources are represented by different colors (A-red, B-green, C-cyan, D-blue). The bottom panel consists of five little windows, representing the five processes. Resources allocated to each process are drawn inside each window, the color representation is the same as the top panel.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gui;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
/**
*
* @author IBM
*/
public class ImagePanel extends javax.swing.JPanel {
private Image BackGroundimage;
public ImagePanel(){
}
public Image getImage() {
return BackGroundimage;
}
public void setImage(Image image) {
this.BackGroundimage = image;
Dimension size=new Dimension(this.getWidth(),this.getHeight());
this.setPreferredSize(size);
this.setMinimumSize(size);
this.setMaximumSize(size);
this.setSize(size);
this.setOpaque(false);
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
}
@Override
public void paintComponent(Graphics g){
if(this.BackGroundimage!=null){
g.drawImage(BackGroundimage, 0, 0,this.getWidth(),this.getHeight(),null);
}
}
}