jframe

Discover jframe, include the articles, news, trends, analysis and practical advice about jframe on alibabacloud.com

Java-socket communication (two-way, with interface)

Server: Import Java. AWT. borderlayout; import Java. AWT. dimension; import Java. AWT. toolkit; import Java. AWT. event. actionevent; import Java. AWT. event. actionlistener; import Java. io. bufferedreader; import Java. io. ioexception; import Java. io. inputstreamreader; import Java. io. printwriter; import java.net. serversocket; import java.net. socket; import javax. swing. jbutton; import javax. swing. jframe; import javax. swing. jpanel; import

Java graphical programming-steps for generating a window

Jframe myframe = new jframe (); // generate a windowMyframe. settitle ("test"); // If the construction parameter called during jframe instantiation is jframe (string), this step can be omitted.Myframe. setdefaclocloseoperation (jframe. exit_on_close); // set to close the win

Java JLayeredPane to implement window background images

Use JLayeredPane to add a background image without affecting the layout of the window components: , After adjusting the window size: [Java]Package com. han;Import java. awt. BorderLayout;Import java. awt. Container;Import java. awt. Dimension;Import java. awt. Image;Import java. awt. Point;Import java. awt. Rectangle;Import java. awt. Toolkit;Import java. awt. event. ComponentAdapter;Import java. awt. event. ComponentEvent;Import javax. swing. BorderFactory;Import javax. swing. ImageIcon;Impor

Java automatically calculates the sum of a numeric column in a table (2)

[Java]Package com. han;Import java. awt. BorderLayout;Import java. awt. Container;Import java. awt. event. MouseAdapter;Import java. awt. event. MouseEvent;Import java. util. Vector;Import javax. swing. JFrame;Import javax. swing. JLabel;Import javax. swing. JOptionPane;Import javax. swing. JPanel;Import javax. swing. JScrollPane;Import javax. swing. JTable;Import javax. swing. JTextField;Import javax. swing. event. TableModelEvent;Import javax. swing

2016.3.16 (Java graphical user interface)

Boundary layoutpublic class Borderlayouttest extends jframe{Public Borderlayouttest () {This.setsize (900,600);This.setdefaultcloseoperation (Jframe.exit_on_close);This.settitle ("Border layout");This.setlocationrelativeto (null);//Set the form to centerThis.addcontent ();This.setvisible (TRUE);}public void Addcontent () {Container con = This.getcontentpane ();Con.setlayout (New BorderLayout ());JButton btn1 = new JButton ("OK 1");JButton btn2 = new J

Java Vamei Quick Tutorial GUI

reuse straight line classes to generate straight lines (of different natures) and combine them into different objects.This is an object-oriented approach to understanding a graph. An object is a natural way to describe a graphic. Object-oriented programming has been a very successful application in computer graphics.A simple GUIJava's GUI functionality is mainly concentrated in the AWT and swing two packages. AWT is the GUI bottom package. Swing packages are high-rise packages that are easier t

Java listens to mouse events

[Java]Package com. han;Import java. awt. Container;Import java. awt. event. MouseEvent;Import java. awt. event. MouseListener;Import javax. swing. JFrame;/*** Listening to mouse events* As you can see, when you double-click the mouse, the first click event is triggered.* @ Author HAN**/Public class MouseEvent_1 extends JFrame {/****/Private static final long serialVersionUID = 7554087008285696671L;Public Mo

Java Swing and thread Combination Application (2)

[Java] Import java. awt. Container;Import java. io. IOException;Import javax. imageio. ImageIO;Import javax. swing. Icon;Import javax. swing. ImageIcon;Import javax. swing. JFrame;Import javax. swing. JLabel;Public class ThreadAndSwing_2 extends JFrame {/****/Private static final long serialVersionUID =-5452173345709313051L;Public ThreadAndSwing_2 (){// TODO Auto-generated constructor stubTry {Final Icon im

Use Socket in Java to implement chat programs

This chat program is very simple, that is, a program acts as a Server and a program acts as a Client ). The Server waits for the Client to establish a Socket connection with it. Once connected, the Server and Client can communicate. This is a basic program for beginners of Java socket! Step 1: Start the Server. java main program. Click Connect; Step 2: Start the Client. java main program. Click Connect. The Code is as follows: Copy code Server. javaImport java. awt. eve

Java Learning Note (ii) graphical user interface

Javax.swing.jframe;public class GUI implements ActionListener {JFrame jf;public static void Main (string[] args) {GUI gui=new gui (); Gui.go ();} public void Go () {jf=new JFrame (); JButton jb=new JButton ("Change Color"); Jf.setdefaultcloseoperation (jframe.exit_on_close);//form Close Jb.addactionlistener (this); Mydrawpanel drawpanel =new Mydrawpanel (); Jf.add (BORDERLAYOUT.SOUTH,JB); Layout

Java interception standard output

(LS. getoutputstream ());System. setout (PS );System. seterr (PS ); Startconsolereaderthread (LS. getinputstream ());} // Leletextarea () Private void startconsolereaderthread (Inputstream instream ){Final bufferedreader BR =New bufferedreader (New inputstreamreader (instream ));New thread (New runnable (){Public void run (){Stringbuffer sb = new stringbuffer ();Try {String S;Document Doc = getdocument ();While (S = Br. Readline ())! = NULL ){Boolean caretatend = false;Caretatend = getcaretposi

Examples of java TCP-based Network Communication

output stream Static PrintStream ps; // Server-related interface components Static JTextArea text; JFrame; Public Server (){// Instantiation of the server interfaceJFrame frame = new JFrame ("server side ");Text = new JTextArea ();JScrollPane scroll = new JScrollPane (text );Frame. add (scroll );Frame. setVisible (true );Frame. setSize (300,400 );// The text box on the server side cannot be edited.Text. s

Java Learning Note (ii) graphical user interface

Javax.swing.jframe;public class GUI implements ActionListener {JFrame jf;public static void Main (string[] args) {GUI gui=new gui (); Gui.go ();} public void Go () {jf=new JFrame (); JButton jb=new JButton ("Change Color"); Jf.setdefaultcloseoperation (jframe.exit_on_close);//form Close Jb.addactionlistener (this); Mydrawpanel drawpanel =new Mydrawpanel (); Jf.add (BORDERLAYOUT.SOUTH,JB); Layout

Java Learning Joptionpane Class

In a graphical user interface (GUI) environment, there are roughly two types of forms: the frame window and the Dialog form (dialog window). In Java, we use the JFrame object as the frame form, using the JDialog object as the dialog form. Here are some common ways to familiarize yourself with the Joptionpane class:1. Joptionpane class method for output--showmesagedialog ()Example (1)--Simple dialog window implementation:Importjavax.swing.*;classshowme

Simple implementation of several common containers for Java swing

One: Divider panel JsplitpanelCode:Import javax.swing.JFrame; import Javax.swing.JButton; import Javax.swing.JLabel; import Javax.swing.JPanel; import Javax.swing.JSplitPane; import Java.awt.Container; class tester{public static void Main (String args[]) { JFrame frame = new JFrame ("JSplitPane test"); Container con = Frame.getcontentpane (); JPanel panel = new JPanel (); JSpli

Atitit. Implementation of the suspended window Java Swing C #. NET C + + JS HTML

. System TrayAuthor :: Old Wow's paw attilax ayron, email:[email protected]Reprint please indicate source: Http://blog.csdn.net/attilax2. Suspended window structure andSignificant points2.1. To remove the title bar:C + + qt is inherited from Qwidget. No tools bar, status bar ...Of course, inheriting from Qmainwindowi is also possible. Setwindowflags (Qt::framelesswindowhintSwing is using JWindow mode, or: J frame.setundecorated (TRUE);//No Titlbar , Jeig defin in java.awt.Frame2.2. OpacityTra

Java graphical programming

ReproducedTo learn the graphical programming of Java Swing, we first need to understand the three most basic concepts: top-level containers, controls, layouts.Here's a look at these three basic concepts1. Top-level containersWhat is a top-level container? When we use Java for graphical programming, where do the graphs draw? We need a container that can provide graphical drawing, which is called the top-level container, and you can think of it as a window. The top-level container is the basis for

With the IFRAME to keep up with the tide

An IFrame is an application window architecture that can have custom colors, custom borders, custom shapes, custom components, and even transparency. With JFrame, you don't always have to use boring, old Jfram in your application. In this article, it expert Michael Aberethy introduces the IFrame class and shows how to use it to instantly convert the standard JFrame application window to an advanced IFRAME.

Split Panel (JSplitPane)

The story of the split panel in Java:The various software we use, including the QQ and window Explorer, can be arbitrarily dragged to size, which is the split panel in Java.First look at a piece of code, split the panel's code, split only two parts.Source:1 Import java.awt.BorderLayout;2 Import Java.awt.Container;3 Import Javax.swing.JFrame;4 Import Javax.swing.JLabel;5 Import Javax.swing.JSplitPane;6 public class Example extends JFrame {7 public stat

Java Common Event Response method instance Rollup _java

//such as "Implements Actionlistener,keylistener" Class Buttonlistener extends JFrame implements actionlistener{JButton OK, cancel,exit;//Create a response-only build, which is three buttons public butt Onlistener (String title) {Super (title); This.setlayout (New FlowLayout ()); OK = new JButton ("OK"); Cancel = new JButton ("return"); Exit = new JButton ("Exit"); The following three statements register the Listener Ok.addactionlistener

Total Pages: 15 1 .... 9 10 11 12 13 .... 15 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.