sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt-get update
sudo apt-get install kdevelop
protected void paintEvent(QPaintEvent e)
painter = new QPainter(this);
// wobec rysowania, prostych, figur itp
painter.setRenderHint(QPainter.RenderHint.Antialiasing);
// wobec rysowania tekstu
painter.setRenderHint(QPainter.RenderHint.TextAntialiasing);
QPen pen = new QPen(QColor.red);
painter.setPen(pen);
// zarówno x jak i y są typu int, messageLine jest typu String (dla C++ jest typu QString)
painter.drawText(x, y, messageLine1);
// x, y współrzędne
// fieldWidth szerokość
// fieldHeight wysokość
// QColor.black kolor
painter.fillRect(x, y, fieldWidth, fieldHeight, QColor.black)
import com.trolltech.qt.gui.*;
public class BlueFrame extends QFrame {
public BlueFrame(QWidget parent)
{
super(parent);
setStyleSheet("background-color:blue");
}
public static void main(String[] args) {
System.out.println("BlueFrame.java");
}
}
try { InputStream in = new BufferedInputStream( new FileInputStream("magiczne liczby.txt"));} catch (IOException e) { e.printStackTrace();}
import java.io.*;
public class AlphaStream extends FilterInputStream { public AlphaStream(InputStream in){ super(in); }
@Override public int read() throws IOException{ int c;
while ((c = super.read()) != -1) { if (Character.isLetter(c) || Character.isWhitespace(c)) return c; } return -1; }}
import java.io.*;
public class Main {
public static void main(String[] argc) { try{ InputStream in = new AlphaStream( new BufferedInputStream(System.in)); String buff = ""; int c; while((c = in.read()) >= 0){ buff += (char)c; } System.out.println(buff); } catch( IOException e) { e.printStackTrace(); } }
}
import com.trolltech.qt.gui.*;
public class MainWindow extends QMainWindow {
Ui_MainWindow ui = new Ui_MainWindow();
public static void main(String[] args) { QApplication.initialize(args);
MainWindow testMainWindow = new MainWindow(); testMainWindow.show();
QApplication.exec(); }
public MainWindow() { ui.setupUi(this); }
public MainWindow(QWidget parent) { super(parent); ui.setupUi(this); }}