Initial Commit

This commit is contained in:
ldy 2025-06-09 13:52:08 +08:00
parent 449679f51d
commit f167cd5389
3085 changed files with 218248 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,854 @@
!SESSION 2023-04-27 09:30:26.938 -----------------------------------------------
eclipse.buildId=4.24.0.I20220607-0700
java.version=17.0.3
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -data C:\Users\s230026071\Desktop\Lab10_2230026071 -product org.eclipse.epp.package.jee.product
!ENTRY org.eclipse.jface 2 0 2023-04-27 09:30:30.091
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2023-04-27 09:30:30.091
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
Open a type in a Java editor,
Category(org.eclipse.ui.category.navigate,Navigate,null,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@21e15093,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
,
Category(org.eclipse.lsp4e.category,Language Servers,null,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@62cf873a,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2023-04-27 09:30:30.091
!MESSAGE A conflict occurred for ALT+SHIFT+R:
Binding(ALT+SHIFT+R,
ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
Rename the selected element,
Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@21b3d356,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+SHIFT+R,
ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename,
Rename the selected item,
Category(org.eclipse.ui.category.file,File,null,true),
org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@294b045b,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!ENTRY org.eclipse.egit.ui 2 0 2023-04-27 09:30:33.185
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\s230026071'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
!SESSION 2023-04-27 16:22:53.228 -----------------------------------------------
eclipse.buildId=4.26.0.20221201-1200
java.version=17.0.6
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -data E:\JAVA 2023\Lab10_2230026071 -product org.eclipse.epp.package.jee.product
!ENTRY ch.qos.logback.classic 1 0 2023-04-27 16:22:54.138
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
!ENTRY org.eclipse.core.resources 4 567 2023-04-27 16:22:54.607
!MESSAGE Workspace restored, but some problems occurred.
!SUBENTRY 1 org.eclipse.core.resources 4 567 2023-04-27 16:22:54.607
!MESSAGE Could not read metadata for '.org.eclipse.egit.core.cmp'.
!STACK 1
org.eclipse.core.internal.resources.ResourceException(/.org.eclipse.egit.core.cmp)[567]: java.lang.Exception: The project description file (.project) for '.org.eclipse.egit.core.cmp' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:908)
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:895)
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:875)
at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:731)
at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1585)
at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2547)
at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2252)
at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:571)
at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:1)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:321)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:264)
at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:545)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:818)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:810)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:767)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1032)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:371)
at org.eclipse.osgi.container.Module.doStart(Module.java:605)
at org.eclipse.osgi.container.Module.start(Module.java:468)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:513)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:570)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:335)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:397)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:496)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:153)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
!SUBENTRY 2 org.eclipse.core.resources 4 567 2023-04-27 16:22:54.607
!MESSAGE The project description file (.project) for '.org.eclipse.egit.core.cmp' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
!STACK 0
java.lang.Exception: The project description file (.project) for '.org.eclipse.egit.core.cmp' is missing. This file contains important information about the project. The project will not function properly until this file is restored.
at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:908)
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:895)
at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:875)
at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:731)
at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1585)
at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2547)
at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2252)
at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:571)
at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:1)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)
at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:321)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:264)
at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:545)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:818)
at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:810)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:767)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1032)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:371)
at org.eclipse.osgi.container.Module.doStart(Module.java:605)
at org.eclipse.osgi.container.Module.start(Module.java:468)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:513)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:117)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:570)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:335)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:397)
at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:496)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:153)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
!ENTRY ch.qos.logback.classic 1 0 2023-04-27 16:22:54.957
!MESSAGE Logback config file: E:\JAVA 2023\Lab10_2230026071\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.1.0.20221015-0744.xml
!ENTRY org.eclipse.jface 2 0 2023-04-27 16:22:56.847
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2023-04-27 16:22:56.847
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
Open a type in a Java editor,
Category(org.eclipse.ui.category.navigate,Navigate,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.navigate.open.type"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
,
Category(org.eclipse.lsp4e.category,Language Servers,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.lsp4e.symbolinworkspace"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2023-04-27 16:22:56.847
!MESSAGE A conflict occurred for ALT+SHIFT+R:
Binding(ALT+SHIFT+R,
ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
Rename the selected element,
Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.edit.text.java.rename.element"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+SHIFT+R,
ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename,
Rename the selected item,
Category(org.eclipse.ui.category.file,File,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.ui.edit.rename"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!ENTRY org.eclipse.egit.ui 2 0 2023-04-27 16:23:00.489
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Danie'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
!ENTRY org.eclipse.jdt.core 4 4 2023-04-27 16:23:00.807
!MESSAGE Exception while reading last build state for: P/Question1
!STACK 1
org.eclipse.core.runtime.CoreException: Error reading last build state for project Question1
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4125)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
... 17 more
!SUBENTRY 1 org.eclipse.jdt.core 4 2 2023-04-27 16:23:00.809
!MESSAGE Error reading last build state for project Question1
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
!ENTRY org.eclipse.jdt.core 4 4 2023-04-27 16:23:00.914
!MESSAGE Exception while reading last build state for: P/Question2
!STACK 1
org.eclipse.core.runtime.CoreException: Error reading last build state for project Question2
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4125)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
... 17 more
!SUBENTRY 1 org.eclipse.jdt.core 4 2 2023-04-27 16:23:00.914
!MESSAGE Error reading last build state for project Question2
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
!ENTRY org.eclipse.jdt.core 4 4 2023-04-27 16:23:00.977
!MESSAGE Exception while reading last build state for: P/Question3
!STACK 1
org.eclipse.core.runtime.CoreException: Error reading last build state for project Question3
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4125)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
... 17 more
!SUBENTRY 1 org.eclipse.jdt.core 4 2 2023-04-27 16:23:00.977
!MESSAGE Error reading last build state for project Question3
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
!ENTRY org.eclipse.jdt.core 4 4 2023-04-27 16:23:01.024
!MESSAGE Exception while reading last build state for: P/Question4
!STACK 1
org.eclipse.core.runtime.CoreException: Error reading last build state for project Question4
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4125)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
... 17 more
!SUBENTRY 1 org.eclipse.jdt.core 4 2 2023-04-27 16:23:01.025
!MESSAGE Error reading last build state for project Question4
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
!ENTRY org.eclipse.jdt.core 4 4 2023-04-27 16:23:01.066
!MESSAGE Exception while reading last build state for: P/Question5
!STACK 1
org.eclipse.core.runtime.CoreException: Error reading last build state for project Question5
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4125)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
... 17 more
!SUBENTRY 1 org.eclipse.jdt.core 4 2 2023-04-27 16:23:01.067
!MESSAGE Error reading last build state for project Question5
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
!ENTRY org.eclipse.jdt.core 4 4 2023-04-27 16:23:01.106
!MESSAGE Exception while reading last build state for: P/Question6
!STACK 1
org.eclipse.core.runtime.CoreException: Error reading last build state for project Question6
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4125)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
... 17 more
!SUBENTRY 1 org.eclipse.jdt.core 4 2 2023-04-27 16:23:01.107
!MESSAGE Error reading last build state for project Question6
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
!ENTRY org.eclipse.jdt.core 4 4 2023-04-27 16:23:01.154
!MESSAGE Exception while reading last build state for: P/Question7
!STACK 1
org.eclipse.core.runtime.CoreException: Error reading last build state for project Question7
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4125)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
... 17 more
!SUBENTRY 1 org.eclipse.jdt.core 4 2 2023-04-27 16:23:01.154
!MESSAGE Error reading last build state for project Question7
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.lambda$1(ClasspathJrt.java:133)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.loadModules(ClasspathJrt.java:129)
at org.eclipse.jdt.internal.core.builder.ClasspathJrt.<init>(ClasspathJrt.java:67)
at org.eclipse.jdt.internal.core.builder.ClasspathLocation.forJrtSystem(ClasspathLocation.java:170)
at org.eclipse.jdt.internal.core.builder.State.readBinaryLocations(State.java:419)
at org.eclipse.jdt.internal.core.builder.State.read(State.java:306)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.readState(JavaBuilder.java:161)
at org.eclipse.jdt.internal.core.JavaModelManager.readStateTimed(JavaModelManager.java:4120)
at org.eclipse.jdt.internal.core.JavaModelManager.readState(JavaModelManager.java:4101)
at org.eclipse.jdt.internal.core.JavaModelManager.getLastBuiltState(JavaModelManager.java:2264)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.getLastState(JavaBuilder.java:450)
at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:190)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1020)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:247)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:392)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:395)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:506)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:454)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:536)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:161)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
!ENTRY org.eclipse.ui 4 0 2023-04-27 16:35:52.164
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.e4.core.di.InjectionException: org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: C:\Program Files\Git\mingw64\share\git\git-for-windows.ico (The system cannot find the path specified))
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:68)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:183)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4785)
at org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
at org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler.handleEvent(UIEventObjectSupplier.java:64)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:133)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setVisible(UIElementImpl.java:361)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributionRecord.updateVisibility(ContributionRecord.java:113)
at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRendererFilter.updateElementVisibility(MenuManagerRendererFilter.java:191)
at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRendererFilter.updateElementVisibility(MenuManagerRendererFilter.java:202)
at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerShowProcessor.showMenu(MenuManagerShowProcessor.java:256)
at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerShowProcessor.menuAboutToHide(MenuManagerShowProcessor.java:114)
at org.eclipse.jface.internal.MenuManagerEventHelper.showEventPostHelper(MenuManagerEventHelper.java:95)
at org.eclipse.jface.action.MenuManager.handleAboutToShow(MenuManager.java:469)
at org.eclipse.jface.action.MenuManager$2.menuShown(MenuManager.java:495)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:259)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4256)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1090)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1071)
at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:5140)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4772)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1478)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2284)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5022)
at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method)
at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:237)
at org.eclipse.swt.widgets.Display.runPopups(Display.java:4095)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3636)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:643)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:171)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
Caused by: org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: C:\Program Files\Git\mingw64\share\git\git-for-windows.ico (The system cannot find the path specified))
at org.eclipse.swt.SWT.error(SWT.java:4918)
at org.eclipse.swt.SWT.error(SWT.java:4833)
at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:184)
at org.eclipse.tm.terminal.view.ui.local.showin.ExternalExecutablesUtils.loadImage(ExternalExecutablesUtils.java:38)
at org.eclipse.tm.terminal.view.ui.local.showin.DynamicContributionItems.getContributionItems(DynamicContributionItems.java:74)
at org.eclipse.ui.actions.CompoundContributionItem.getContributionItemsToFill(CompoundContributionItem.java:83)
at org.eclipse.ui.actions.CompoundContributionItem.fill(CompoundContributionItem.java:57)
at org.eclipse.ui.internal.menus.DynamicMenuContributionItem.fill(DynamicMenuContributionItem.java:146)
at org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:729)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:806)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java:673)
at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.scheduleManagerUpdate(MenuManagerRenderer.java:1227)
at org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.subscribeUIElementTopicVisible(MenuManagerRenderer.java:213)
at jdk.internal.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
... 62 more
Caused by: java.io.FileNotFoundException: C:\Program Files\Git\mingw64\share\git\git-for-windows.ico (The system cannot find the path specified)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:111)
at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:181)
... 76 more
!SESSION 2023-04-27 18:41:23.726 -----------------------------------------------
eclipse.buildId=4.26.0.20221201-1200
java.version=17.0.6
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
!ENTRY ch.qos.logback.classic 1 0 2023-04-27 18:41:24.921
!MESSAGE Activated before the state location was initialized. Retry after the state location is initialized.
!ENTRY ch.qos.logback.classic 1 0 2023-04-27 18:41:25.903
!MESSAGE Logback config file: E:\JAVA 2023\Lab10_2230026071\.metadata\.plugins\org.eclipse.m2e.logback\logback.2.1.0.20221015-0744.xml
!ENTRY org.eclipse.jface 2 0 2023-04-27 18:41:28.387
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2023-04-27 18:41:28.387
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
Open a type in a Java editor,
Category(org.eclipse.ui.category.navigate,Navigate,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.navigate.open.type"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
,
Category(org.eclipse.lsp4e.category,Language Servers,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.lsp4e.symbolinworkspace"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2023-04-27 18:41:28.387
!MESSAGE A conflict occurred for ALT+SHIFT+R:
Binding(ALT+SHIFT+R,
ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
Rename the selected element,
Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.edit.text.java.rename.element"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+SHIFT+R,
ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename,
Rename the selected item,
Category(org.eclipse.ui.category.file,File,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.ui.edit.rename"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!ENTRY org.eclipse.egit.ui 2 0 2023-04-27 18:41:30.383
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Danie'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
!ENTRY org.eclipse.oomph.ui 4 0 2023-04-27 18:41:36.164
!MESSAGE java.lang.ExceptionInInitializerError
!STACK 0
java.lang.ExceptionInInitializerError
at org.eclipse.oomph.setup.ui.recorder.RecorderManager.<clinit>(RecorderManager.java:121)
at org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(SetupUIPlugin.java:216)
at org.eclipse.oomph.setup.ui.EarlyStartup.earlyStartup(EarlyStartup.java:23)
at org.eclipse.oomph.internal.ui.EarlyStart.run(EarlyStart.java:119)
at org.eclipse.oomph.internal.ui.EarlyStart$1.run(EarlyStart.java:98)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.osgi.framework.BundleContext.getServiceReference(java.lang.Class)" because "context" is null
at org.eclipse.oomph.p2.internal.core.AgentManagerImpl.getCurrentAgent(AgentManagerImpl.java:169)
at org.eclipse.oomph.p2.core.P2Util.getCurrentProvisioningAgent(P2Util.java:112)
at org.eclipse.oomph.setup.internal.core.util.SetupCoreUtil.<clinit>(SetupCoreUtil.java:157)
... 6 more

View File

@ -0,0 +1,24 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 17, 120, 80);
g.drawLine(180, 27, 180, 80);
}
}

View File

@ -0,0 +1,16 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLUE);
g.drawString("hello",20, 80);
g.drawString("hello",
(int)Math.round(Math.random() * this.getWidth()),
(int)Math.round(Math.random() * this.getHeight()));
}
}

View File

@ -0,0 +1,51 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JPanel p1 = new JPanel();
BorderLayout bl = new BorderLayout();
p1.setLayout(bl);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
FlowLayout f1 = new FlowLayout(FlowLayout.CENTER);
p2.setLayout(f1);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
GridLayout g1 = new GridLayout(2, 2);
p3.setLayout(g1);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,14 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(20,20,60,60);
g.drawRect(10,10,60,60);
}
}

View File

@ -0,0 +1,17 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 10);
}
}

View File

@ -0,0 +1,17 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,54 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JPanel p1 = new JPanel();
BorderLayout bl = new BorderLayout();
p1.setLayout(bl);
this.add(p1);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
FlowLayout f1 = new FlowLayout(FlowLayout.CENTER);
p2.setLayout(f1);
this.add(p2);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
GridLayout g1 = new GridLayout(2, 2);
p3.setLayout(g1);
//this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,54 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JPanel p1 = new JPanel();
BorderLayout bl = new BorderLayout();
p1.setLayout(bl);
this.add(p1);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
FlowLayout f1 = new FlowLayout(FlowLayout.CENTER);
p2.setLayout(f1);
this.add(p2);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
GridLayout g1 = new GridLayout(2, 2);
p3.setLayout(g1);
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,16 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
}
}

View File

@ -0,0 +1,67 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
//JButton b2 = new JButton("b2");
this.add(new JButton("b1"), BorderLayout.LINE_START);
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when add more than one component to one of the five areas of the frame, overlap would occurs
//when one area does not contain any components, this area would missing
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
//this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
//this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout((new FlowLayout(FlowLayout.CENTER));
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.CENTER);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.CENTER);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,15 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
}
}

View File

@ -0,0 +1,51 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
//this.add(p2);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
//this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,58 @@
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
//Only one button appear as Java would detect same button and remove
/*
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new BorderLayout());
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1, BorderLayout.LINE_START);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2, BorderLayout.CENTER);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3, BorderLayout.PAGE_END);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new GridLayout(5, 1));
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
//JButton b2 = new JButton("b2");
this.add(new JButton("b1"), BorderLayout.LINE_START);
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,14 @@
public class Start {
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new MyFrame();
new MyFrame();
}
});
}
}

View File

@ -0,0 +1,28 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.add(new MyPanel());
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,24 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 20, 120, 80);
g.drawLine(180, 20, 180, 80);
}
}

View File

@ -0,0 +1,57 @@
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,51 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JPanel p1 = new JPanel();
BorderLayout bl = new BorderLayout();
p1.setLayout(bl);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
FlowLayout f1 = new FlowLayout(FlowLayout.CENTER);
p2.setLayout(f1);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
GridLayout g1 = new GridLayout(2, 2);
p3.setLayout(g1);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,21 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 30, 10);
}
}

View File

@ -0,0 +1,16 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLUE);
//g.drawString("hello",20, 80);
g.drawString("hello",
(int)Math.round(Math.random() * this.getWidth()),
(int)Math.round(Math.random() * this.getHeight()));
}
}

View File

@ -0,0 +1,31 @@
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,14 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new GridLayout(3, 2));
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,16 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLUE);
//g.drawString("hello",20, 80);
g.drawString("hello",
(int)Math.round(Math.random() * this.getWidth()),
(int)Math.round(Math.random() * this.getHeight()));
}
}

View File

@ -0,0 +1,58 @@
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/*
//Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new GridLayout(3, 1));
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
//JButton b2 = new JButton("b2");
this.add(new JButton("b1"), BorderLayout.PAGE_START);
this.add(new JButton("b2"), BorderLayout.PAGE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,14 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(20,20,60,60);
g.drawRect(10,30,60,60);
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
JButton b2 = new JButton("b2");
this.add(new JButton("b1"), BorderLayout.LINE_START);
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,67 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title");
this.setSize(400, 300);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
//the layout did not changed as the components are already parallel-aligned
//if set number of rows = 0, it would aligned in one row
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when add more than one component to one of the five areas of the frame, overlap would occurs
//when one area does not contain any components, this area would missing
this.setVisible(true);
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,14 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,30,60,60);
g.drawRect(10,30,60,60);
}
}

View File

@ -0,0 +1,16 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLUE);
//g.drawString("hello",20, 80);
g.drawString("hello",
(int)Math.round(Math.random() * this.getWidth()),
(int)Math.round(Math.random() * this.getHeight()));
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,53 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new GridLayout(3, 1));
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,66 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
//JButton b2 = new JButton("b2");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
//this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
//this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
//this.add(cb2, BorderLayout.LINE_END);
//when add more than one component to one of the five areas of the frame, overlap would occurs
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,23 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 10, 120, 70);
}
}

View File

@ -0,0 +1,24 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 17, 120, 77);
g.drawLine(180, 27, 180, 80);
}
}

View File

@ -0,0 +1,23 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 15, 120, 75);
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new BorderLayout());
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1, BorderLayout.PAGE_START);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2, BorderLayout.CENTER);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3, BorderLayout.PAGE_END);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,14 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(20,20,60,60);
g.drawRect(10,40,60,60);
}
}

View File

@ -0,0 +1,14 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,30,60,60);
}
}

View File

@ -0,0 +1,24 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 17, 120, 77);
g.drawLine(180, 17, 180, 77);
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,28 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.add(new MyPanel());
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,13 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(10,10,10,10);
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new GridLayout(3, 1));
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,16 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLUE);
//g.drawString("hello",20, 80);
g.drawString("hello",
(int)Math.round(Math.random() * this.getWidth()),
(int)Math.round(Math.random() * this.getHeight()));
}
}

View File

@ -0,0 +1,24 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 20, 120, 80);
g.drawLine(120, 80, 120, 80);
}
}

View File

@ -0,0 +1,14 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,20,60,60);
g.drawRect(10,30,60,60);
}
}

View File

@ -0,0 +1,18 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
}
}

View File

@ -0,0 +1,17 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
//g.drawLine(90, 10, 70, 10);
}
}

View File

@ -0,0 +1,21 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.AFTER_LINE_ENDS);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,51 @@
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,31 @@
import java.awt.FlowLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title");
this.setSize(400, 300);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,21 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 20);
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout b1 = new BorderLayout();
this.setLayout(b1);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,16 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 90);
}
}

View File

@ -0,0 +1,57 @@
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
GridLayout g1 = new GridLayout();
this.setLayout(g1);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,13 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.BLUE);
g.drawString("hello",20, 80);
}
}

View File

@ -0,0 +1,24 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 17, 120, 77);
g.drawLine(180, 27, 180, 77);
}
}

View File

@ -0,0 +1,13 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(10,10,100,100);
}
}

View File

@ -0,0 +1,23 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(30,10,60,60);
g.drawRect(10,20,60,60);
g.drawLine(30, 10, 10, 20);
g.drawLine(90, 70, 70, 80);
g.drawLine(90, 10, 70, 20);
g.drawLine(30, 70, 10, 80);
g.setColor(Color.BLUE);
g.drawOval(120, 10, 60, 15);
g.drawOval(120, 70, 60, 15);
g.drawLine(120, 20, 120, 80);
}
}

View File

@ -0,0 +1,54 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JPanel p1 = new JPanel();
BorderLayout bl = new BorderLayout();
p1.setLayout(bl);
this.add(p1);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
FlowLayout f1 = new FlowLayout(FlowLayout.CENTER);
p2.setLayout(f1);
this.add(p2);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
GridLayout g1 = new GridLayout(2, 2);
p3.setLayout(g1);
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title");
this.setSize(400, 300);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
//the layout did not changed as the components are already parallel-aligned
//if set number of rows = 0, it would auto ask new lines w.r.t. number of columns
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when add more than one component to one of the five areas of the frame, overlap would occurs
//when one area does not contain any components, this area would missing
this.setVisible(true);
}
}

View File

@ -0,0 +1,57 @@
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JButton b1 = new JButton("b1");
this.add(b1);
JButton b2 = new JButton("b2");
this.add(b2);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
JLabel l = new JLabel("Enter your name: ");
this.add(l);
JTextField tx = new JTextField("Type Text Here");
this.add(tx);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,14 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(20,20,60,60);
g.drawRect(10,30,60,60);
}
}

View File

@ -0,0 +1,67 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
//JButton b2 = new JButton("b2");
this.add(new JButton("b1"), BorderLayout.LINE_START);
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when add more than one component to one of the five areas of the frame, overlap would occurs
//when one area does not contain any components, this area would missing
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,65 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
//JButton b1 = new JButton("b1");
this.add(new JButton("b1"), BorderLayout.LINE_START);
//JButton b2 = new JButton("b2");
this.add(new JButton("b2"), BorderLayout.LINE_END);
/* Only one button appear as Java would detect same button and remove
JButton b = new JButton("B1");
this.add(b);
this.add(b);
*/
/*
FlowLayout f1 = new FlowLayout(FlowLayout.LEFT, 20, 40);
this.setLayout(f1);
*/
/*
GridLayout g1 = new GridLayout(5, 5);
this.setLayout(g1);
*/
//the program presents in 4*2 layout
//the program did not use the specified rows and columns, because the lack numbers of components
BorderLayout bl = new BorderLayout();
this.setLayout(bl);
JLabel l = new JLabel("Enter your name: ");
this.add(l, BorderLayout.LINE_START);
JTextField tx = new JTextField("Type Text Here");
this.add(tx, BorderLayout.CENTER);
JCheckBox cb = new JCheckBox("I agree");
this.add(cb, BorderLayout.LINE_END);
JRadioButton rb = new JRadioButton("Yes");
this.add(rb, BorderLayout.AFTER_LINE_ENDS);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
this.add(cb1, BorderLayout.CENTER);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
this.add(cb2, BorderLayout.LINE_END);
//when stretching the window, the components would realign to one row if space permits
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new GridLayout(3, 1));
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,51 @@
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,13 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawString("hello",20, 80);
}
}

View File

@ -0,0 +1,13 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(50,50,60,60);
}
}

View File

@ -0,0 +1,16 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
//g.setColor(Color.BLUE);
//g.drawString("hello",20, 80);
g.drawString("hello",
(int)Math.round(Math.random() * this.getWidth()),
(int)Math.round(Math.random() * this.getHeight()));
}
}

View File

@ -0,0 +1,56 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
public class MyFrame extends JFrame{
//constructor
public MyFrame() {
this.setTitle("MyFrame Title"); //if comment out, the title would be blank
this.setSize(400, 300); //if comment out, the initiated size would be 0
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //if comment out, the program would still running after clicked close button
this.setLocationRelativeTo(null); //if comment out, the frame would appear at (0, 0)
this.setLayout(new FlowLayout(FlowLayout.CENTER));
JPanel p1 = new JPanel();
p1.setLayout(new BorderLayout());
this.add(p1);
p1.setBackground(Color.BLUE);
p1.add(new JButton("b1"), BorderLayout.LINE_START);
p1.add(new JButton("b2"), BorderLayout.LINE_END);
JPanel p2 = new JPanel();
p2.setLayout(new FlowLayout(FlowLayout.CENTER));
this.add(p2);
p2.setBackground(Color.GREEN);
JLabel l = new JLabel("Enter your name: ");
p2.add(l);
JTextField tx = new JTextField("Type Text Here");
p2.add(tx);
JPanel p3 = new JPanel();
p3.setLayout(new GridLayout(2, 2));
this.add(p3);
JCheckBox cb = new JCheckBox("I agree");
p3.add(cb);
JRadioButton rb = new JRadioButton("Yes");
p3.add(rb);
JComboBox<String> cb1 = new JComboBox<String>(new String[]{"Red", "Green", "Blue"});
p3.add(cb1);
JComboBox<Integer> cb2 = new JComboBox<Integer>(new Integer[]{2, 7, -3, 24});
p3.add(cb2);
this.setVisible(true); //if comment out, the window would not be visible
}
}

View File

@ -0,0 +1,13 @@
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JPanel;
public class MyPanel extends JPanel{
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.RED);
g.drawRect(10,10,60,60);
}
}

View File

@ -0,0 +1,13 @@
public class Start {
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new MyFrame();
}
});
}
}

Some files were not shown because too many files have changed in this diff Show More