Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Commonmark migration
Source Link

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that [![][1]][1]
(source: scaleengine.net)

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank? [1]: https://i.sstatic.net/wYU9s.png

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that [![][1]][1]
(source: scaleengine.net)

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank? [1]: https://i.sstatic.net/wYU9s.png

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that
(source: scaleengine.net)

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank?

broken image fixed (click 'side-by-side' to see the difference; image retrieved via Wayback Machine); for more info, see https://gist.github.com/Glorfindel83/9d954d34385d2ac2597bbe864466259f
Source Link
Glorfindel
  • 22.8k
  • 13
  • 97
  • 124

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that [![][1]][1]
(source: scaleengine.net )

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank? [1]: https://i.sstatic.net/wYU9s.png

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank?

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that [![][1]][1]
(source: scaleengine.net )

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank? [1]: https://i.sstatic.net/wYU9s.png

replaced http://sc-cdn.scaleengine.net/i/07ad762a0450ac18e60bc0083a5018a6.png with https://sc-cdn.scaleengine.net/i/07ad762a0450ac18e60bc0083a5018a6.png
Source Link
URL Rewriter Bot
URL Rewriter Bot

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that http://sc-cdn.scaleengine.net/i/07ad762a0450ac18e60bc0083a5018a6.png

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank?

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that http://sc-cdn.scaleengine.net/i/07ad762a0450ac18e60bc0083a5018a6.png

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank?

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't work even if it's correctly typed onto my screen. So, now I used thenewboston's first tutorial with Java GUI. Typed all syntax correctly, classes seems fine, no errors. He got window that was expected - mine only got blank window with no title and no text.

Screenshot with that

Code in JFrames.java file:

import java.awt.FlowLayout; // importē plūstošo skatu / default layout
import javax.swing.JFrame; // dod iespēju piekļūt pamata logu struktūrai
import javax.swing.JLabel; // ļauj rakstīt tekstu logos
public class JFrames extends JFrame {
 private JLabel item1;
 
 public JFrames() {
 super("The Title Of The Program"); // parāda title bar ar tekstu
 setLayout(new FlowLayout());
 
 item1 = new JLabel("This is sentence with something");
 item1.setToolTipText("This is tooltip on hover");
 add(item1); // pievieno logam šo lietiņu
 }
}

Please, ignore latvian comments, that's just for my reference. So I want to know - why my window appears blank?

edited tags
Link
splungebob
  • 5.4k
  • 2
  • 24
  • 48
Loading
added 46 characters in body
Source Link
John Kugelman
  • 364.7k
  • 70
  • 555
  • 600
Loading
Post Migrated Here from programmers.stackexchange.com (revisions)
Source Link
Loading
lang-java

AltStyle によって変換されたページ (->オリジナル) /