Font size spinner now updates the opened tabs without needing to click the "Refresh" button. I didn't realize there was already a method that would accomplish this. Also, since finding this method, I found that it would produce an exception, which is now fixed.

This commit is contained in:
Cody 2024-04-12 19:58:18 -06:00
parent d30d36eb74
commit d633fd00ce

AI 샘플 코드 생성 중입니다

Loading...
2 changed files with 4 additions and 6 deletions

View File

@ -675,7 +675,7 @@ public class BytecodeViewer
}
/**
* Refreshes the title on all of the opened tabs
* Refreshes all the opened tabs
*/
public static void refreshAllTabs()
{
@ -684,7 +684,7 @@ public class BytecodeViewer
updateBusyStatus(true);
for (int i = 0; i < BytecodeViewer.viewer.workPane.tabs.getTabCount(); i++)
{
ResourceViewer viewer = ((TabbedPane) BytecodeViewer.viewer.workPane.tabs.getTabComponentAt(i)).resource;
ResourceViewer viewer = (ResourceViewer) BytecodeViewer.viewer.workPane.tabs.getComponentAt(i);
viewer.refresh(null);
}
updateBusyStatus(false);

View File

@ -2,10 +2,8 @@ package the.bytecode.club.bytecodeviewer.gui;
import java.awt.*;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.*;
import java.util.List;
import java.util.Map;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@ -352,7 +350,6 @@ public class MainViewerGUI extends JFrame
uiComponents.add(resourcePane);
uiComponents.add(searchBoxPane);
uiComponents.add(workPane);
// uiComponents.add(hierarchy);
viewPane1.setDefault();
viewPane2.setDefault();
@ -465,6 +462,7 @@ public class MainViewerGUI extends JFrame
BytecodeViewer.updateAllFonts(font);
BytecodeViewer.updateUI();
BytecodeViewer.refreshAllTabs();
});
fontSize.add(fontSpinner);