среда, 29 июля 2015 г.

Helloworld in Java Graphics2D

For this need to make 2 classes with names Painting and Frame. In my situation I have package named graphh
Painting.class:
package graphh;
import java.awt.*;
import javax.swing.*;
public class Painting extends JPanel {
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawOval(60, 80, 20, 20);
}
}

Frame.class:
package graphh;
import java.awt.*;
import javax.swing.*;
public class Frame {
public Frame() {
JFrame gui = new JFrame();
gui.setTitle("fsdfdsf");
gui.setSize(400, 300);
gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Painting panel = new Painting();
Container pane = gui.getContentPane();
pane.setLayout(new GridLayout(1, 1));
pane.add(panel);
gui.setVisible(true);
}
public static void main(String args[]) {
new Frame();
}
}

If you are using Eclipse just press Run button
Taken from https://www.youtube.com/watch?v=U2G_2AS0otE

среда, 22 июля 2015 г.

Cannot add icons in KDE

Simply add extracted icons into /usr/share/icons and restart KDE Icons Settings window.

How to fix tk and tkinter error in Arch

In Arch, if you have similar error:
$ Traceback (most recent call last):
 File "main.pyw", line 43, in <module>
   run_main()
 File "main.pyw", line 31, in run_main
   import src.app
 File "/run/media/dc/62AA14DBAA14AD93/Program Files (x86)/LearningEnglish-master/src/
app.py", line 7, in <module>
   from GUI import MainWindow
 File "/run/media/dc/62AA14DBAA14AD93/Program Files (x86)/LearningEnglish-master/src/
GUI.py", line 3, in <module>
   from tkFont import Font
 File "/usr/lib/python2.7/lib-tk/tkFont.py", line 11, in <module>
   import Tkinter
 File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
   import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
Just install short package named tk from official packages.

Do not show window title in Opera and KDE


When you want to quickly switch between Opera tabs, you need to remove common window borders.
  1. go to the System Settings > Window Management > tab Window rules, press New... 
  2. press on Detect Window Properties and click and drag on Opera window
  3. in new window press Ok
  4. in tab Appearance & Fixes add tick on No titlebar and frame, in dropdown list select Apply initially, and select Yes
  5. in previous tab enter own name of rule
  6. Don't forget to press Ok and in Window Rules press Apply on bottom

вторник, 21 июля 2015 г.

cool windows 8 font for notepad


You need to install font Consolas. It is in Microsoft Windows font kit.