jframe

How to implement graphics to JScrollPane?

牧云@^-^@ 提交于 2020-04-30 03:51:59
问题 The objective is to draw a couple hundred thousand vertical lines to a window, for which reason I need a scroll bar, zooming out is not an option as the space separating each individual line is not even a pixel. I have taken the approach of using paint methods in a class and adding both the class and JScrollPane to a JFrame. Didn't work out which is why I took the approach of using the NetBeans JFrame Form. Basically, how do I implement my graphics method into the panel that has the scroll

How to implement graphics to JScrollPane?

老子叫甜甜 提交于 2020-04-30 03:51:07
问题 The objective is to draw a couple hundred thousand vertical lines to a window, for which reason I need a scroll bar, zooming out is not an option as the space separating each individual line is not even a pixel. I have taken the approach of using paint methods in a class and adding both the class and JScrollPane to a JFrame. Didn't work out which is why I took the approach of using the NetBeans JFrame Form. Basically, how do I implement my graphics method into the panel that has the scroll

201871010112-梁丽珍《面向对象程序设计(java)》第十二周学习总结

依然范特西╮ 提交于 2020-04-28 09:02:37
项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p/11867214.html 作业学习目标                 (1) 掌握Vetor、Stack、Hashtable三个类的用途及常用API;                 (2) 掌握ArrayList、LinkList两个类的用途及常用API;                 (3) 了解java集合框架体系组成;                 (4) 掌握Java GUI中框架创建及属性设置中常用类的API;                 (5) 了解Java GUI中2D图形绘制常用类的API; 第一部分:总结第九章、第十章理论知识 第9章 集合 ●JAVA中的集合框架 ●JDK1.1版本集合类. ●JDK1.2以上版本集合类 JAVA的集合框架 1)JAVA的集合框架实现对各种数据结构的封装。 2)所谓框架就是一个类库,框架中包含一些通用接口和超类,编程者实现这些接口或创建这些超类的子类就可方便的设计程序所需的类。 3)集合(或称为容器)是一类包含多个元素并提供对所包含元素操作方法的类,其包含的元素可以由同一类型的对象组成,也可以由不同类型的对象组成。 4

201271050130-滕江南-《面向对象程序设计(java)》第十三周学习总结

筅森魡賤 提交于 2020-04-27 20:01:05
201271050130-滕江南-《面向对象程序设计(java)》第十三周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p/11888568.html 作业学习目标 (1) 掌握事件处理的基本原理,理解其用途; (2) 掌握AWT事件模型的工作机制; (3) 掌握事件处理的基本编程模型; (4) 了解GUI界面组件观感设置方法; (5) 掌握WindowAdapter类、AbstractAction类的用法; (6) 掌握GUI程序中鼠标事件处理技术。 第一部分:理论知识学习部分 第11章 事件处理 11.1 事件处理基础 a)事件源(event source):能够产生事件的对象都可 以成为事件源,如文本框、按钮等。一个事件源是一个 能够注册监听器并向监听器发送事件对象的对象。 b) 事件监听器(event listener):事件监听器对象接 收事件源发送的通告(事件对象),并对发生的事件作 出响应。一个监听器对象就是一个实现了专门监听器接 口的类实例,该类必须实现接口中的方法,这些方法当 事件发生时,被自动执行。 c) 事件对象(event object):Java将事件的相关信息 封装在一个事件对象中

201771010112罗松《面向对象程序设计(java)》第十三周学习总结

强颜欢笑 提交于 2020-04-27 20:00:25
一、实验目的与要求 (1) 掌握事件处理的基本原理,理解其用途; (2) 掌握AWT事件模型的工作机制; (3) 掌握事件处理的基本编程模型; (4) 了解GUI界面组件观感设置方法; (5) 掌握WindowAdapter类、AbstractAction类的用法; (6) 掌握GUI程序中鼠标事件处理技术。 二、实验内容和步骤 实验1: 导入第11章示例程序,测试程序并进行代码注释。 测试程序1: l 在elipse IDE中调试运行教材443页-444页程序11-1,结合程序运行结果理解程序; l 在事件处理相关代码处添加注释; l 用lambda表达式简化程序; l 掌握JButton组件的基本API; l 掌握Java中事件处理的基本编程模型。 package button; import java.awt. * ; import javax.swing. * ; /* * * @version 1.34 2015-06-12 * @author Cay Horstmann */ public class ButtonTest { public static void main(String[] args) { EventQueue.invokeLater(() -> { JFrame frame = new ButtonFrame(); frame.setTitle( "

201871010108-高文利《面向对象程序设计(java)》第十周学习总结

自作多情 提交于 2020-04-26 08:43:17
项目 内容 这个作业属于哪个课程 < 任课教师博客主页链接 > https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 < 作业链接地址 > https://www.cnblogs.com/nwnu-daizh/p/11778090.html 作业学习目标       1.掌握 java 异常处理技术; 2. 了解断言的用法;       3. 了解日志的用途;       4. 掌握程序基础调试技巧。 第一部分:总结第七章关于异常处理相关理论知识( 20 分)   1、异常:在程序的执行过程中所发生的异常事件,它中断指令的正常执行。 常见的几种错误: 用户输入错误; 设备错误 物理限制。 2、所有的异常都是由Throwable类继承而来,在下一层分解为两个分支:Error和Exception。 (1)Error类层次结构描述了Java运行时系统的内部错误和资源耗尽错误。应用程序不应该抛出这种类型的对象。 (2)在设计Java程序时,需要关注Exception层次结构。这个层次结构又分解为两个分支:一个分支派生于RuntimeException;另一个分支包含其他异常。 3、派生于于RuntimeException的异常包含下面几种情况: (1)错误的类型转换。 (2)数组访问越界。 (3)访问null指针。 4

Show the JInternalFrame data in the middle of the form

霸气de小男生 提交于 2020-04-16 05:47:36
问题 I am using JFrame which contains three sections. 1st section is Pane, which contains the 6 menu button (left side). 2nd section is also Pane, which displays the logo of the company on the top. The third section is DesktopPane in which I am using (calling) JInterenalFrame in the DesktopPane. How to always show the JInterenalFrame content (form data) into the middle of DesktopPane? 回答1: Third section is DesktopPane in which I am using(calling) JInterenalFrame in the DesktopPane. A JDesktopPane

How to move undecorated JFrame by holding click on a JPanel in Java? [duplicate]

瘦欲@ 提交于 2020-04-15 04:33:12
问题 This question already has answers here : Drag and Resize undecorated JFrame (2 answers) Closed 5 years ago . I've been making an undecorated JFrame so far and I was wondering if it's possible to move the undecorated JFrame by holding click on a JPanel. Here is the source code I'm working on. private static void createFrame() { JFrame frame = new JFrame("Text Frame"); frame.setLayout(null); frame.setSize(500,300); frame.setUndecorated(true); JPanel panel = new JPanel(); panel.setBounds(0, 2,

Java Swing applicaion gif animation leaving a trail

五迷三道 提交于 2020-03-25 17:51:12
问题 Hey all I am wondering if I can fix my animation issue. Currently it does animate just fine but with one issue - it seems to leave training images behind as it animates. This is my code I am using: import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Point; import java.awt.RenderingHints; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event

How to launch command line Java code inside a JFrame?

本秂侑毒 提交于 2020-03-22 07:37:11
问题 I have a Java program which is executed through the basic command line interface. I am wondering about put it in a window JFrame. Is it possible? How can I do? Thank you. 回答1: If you want command line inside a jFrame I think it is not a good idea. If the JFrame is started that means the program is already started. You have to start the program using command line or running a executable jar file.So there is no meaning in what you are going to do. If you want to see your output inside a JFrame