MillGrantz Posted March 9, 2023 Posted March 9, 2023 What I'm trying to do is add the items in my inventory to my gui. Should I add extends JFrame and Script to get the active items into the enum InventoryItems Item[] itemsInventory = getInventory().getItems(); here's my GUI class public class Gui extends JFrame { enum InventoryItems { item1, item2, item3; @Override public String toString() { return name().toLowerCase(); } }
Chris Posted March 10, 2023 Posted March 10, 2023 https://www.geeksforgeeks.org/java-swing-jlist-with-examples/ 1
MillGrantz Posted March 10, 2023 Author Posted March 10, 2023 The issue with that is that the main gui doesn't extend from Script since it can't have 2 imports to get the inventory directly to the gui.