Programacion Orientada a Objetos, Lab Reports of Software Development

Programacion Orientada a Objetos

Typology: Lab Reports

2023/2024

Uploaded on 01/13/2025

rigo-cardenas
rigo-cardenas 🇺🇸

2 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5

Partial preview of the text

Download Programacion Orientada a Objetos and more Lab Reports Software Development in PDF only on Docsity!

File - C:\Users\Public\memoria\src\Memoria java 1 import javax.swing.*; 2 import java.awt.*; 3 import java.awt.event.ActionEvent; 4 import java.awt.event.ActionListener; 5 import java.util.ArrayList; 6 7 class Proceso { 8 String nombre; 9 int tamano; 10 11 public Proceso(String nombre, int tamano) { 12 this.nombre = nombre; 13 this.tamano = tamano; 14 } 15 16 @Override 17 public String toString() { 18 return "Proceso{" + 19 "nombre='" + nombre + '\'' + 20 ", tamano=" + tamano + 21 "yy 22 } 23 } 24 25 public class Memoria { 26 static ArrayList procesos = new ArrayList<>(); 27 static int memoriaTotal = 1024; // Memoria total disponible 28 static int memoriaLibre = memoriaTotal; // Memoria libre disponible 29 static JFrame ventana; 30 static JList ListaProcesos; 31 static DefaultListModel modeloLista; 32 static JLabel etiquetaMemoriaLibre; 33 static JTextArea textoComparacion; 34 35 public static void main(String[] args) { 36 SwingUtilities.invokeLater(new Runnable() { 37 @Override 38 public void run() { Page 1 of 6