Skip to content

Commit

Permalink
move Resources to Images under src to facilitate a packages jar. Upda…
Browse files Browse the repository at this point in the history
…te DnDTabbedPane. Tabs no longer wrap, but are inline - use the mouse scroll to navigate.
  • Loading branch information
matty-r committed Aug 21, 2023
1 parent c65ec31 commit a085560
Show file tree
Hide file tree
Showing 14 changed files with 490 additions and 436 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,5 @@ pip-log.txt
*.iml
Logs/*
.vscode/*
out/*
lib/*
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 3 additions & 1 deletion src/urChatBasic/base/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.awt.Font;
import java.io.File;
import java.net.URL;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
Expand All @@ -10,6 +11,7 @@
import javax.swing.JLabel;
import urChatBasic.backend.Connection;
import urChatBasic.base.capabilities.CapabilityTypes;
import urChatBasic.frontend.DriverGUI;
import urChatBasic.frontend.UserGUI;

/**
Expand All @@ -22,7 +24,7 @@
public class Constants
{

public static final String RESOURCES_DIR = "Resources" + File.separator;
public static final URL RESOURCES_DIR = DriverGUI.class.getResource(File.separator + "images" + File.separator);
public static String DIRECTORY_LOGS = "Logs" + File.separator;
public static Class BACKEND_CLASS;
public static String BACKEND_CLASS_FULLNAME = "urChatBasic.backend.Connection";
Expand Down
6 changes: 3 additions & 3 deletions src/urChatBasic/base/IRCRoomBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import java.awt.event.*;
import java.awt.*;
import java.io.*;
import java.net.URL;
import java.text.*;
import java.util.*;
import java.util.List;
import java.util.logging.Level;
import java.util.prefs.Preferences;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.Timer;
import javax.swing.event.MouseInputAdapter;
Expand Down Expand Up @@ -169,8 +169,8 @@ public IRCRoomBase(IRCServerBase server, String roomName)

try
{
Image tempIcon = ImageIO.read(new File(Constants.RESOURCES_DIR + "Room.png"));
icon = new ImageIcon(tempIcon);
URL imgPath = new URL(Constants.RESOURCES_DIR + "Room.png");
icon = new ImageIcon(imgPath);
} catch (IOException e)
{
Constants.LOGGER.log(Level.SEVERE, "FAILED TO LOAD Room.png: " + e.getLocalizedMessage());
Expand Down
Loading

0 comments on commit a085560

Please sign in to comment.