Go to advanced search

by knute
Sat Aug 17, 2019 7:37 pm
Forum: Python
Topic: Old-school GUI - Possible? (Beware, silly purpose)
Replies: 25
Views: 1146

Re: Old-school GUI - Possible? (Beware, silly purpose)

And an example of setting up your menu with buttons. You will see right away why I used the labels in the original but it does work. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Buttons extends JFrame { private Color mBlue = new Color(0x3e86ca); private Color mGreen...
by knute
Sat Aug 17, 2019 7:01 pm
Forum: Python
Topic: Old-school GUI - Possible? (Beware, silly purpose)
Replies: 25
Views: 1146

Re: Old-school GUI - Possible? (Beware, silly purpose)

One way to swap out panels with a button: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Panels extends JFrame { private final Panel1 panel1; private final Panel2 panel2; public Panels() { super("Panels"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setPreferre...
by knute
Sat Aug 17, 2019 6:37 pm
Forum: Python
Topic: Old-school GUI - Possible? (Beware, silly purpose)
Replies: 25
Views: 1146

Re: Old-school GUI - Possible? (Beware, silly purpose)

Okay might need a bit more help... :lol: So, code is running fine, currently looking at on the PC just to have a better workspace - using Eclipse. Again, never used JAVA, but some things are clear to me, like the button actions and the buttons used: class TabAction extends AbstractAction { public v...
by knute
Tue Aug 13, 2019 9:38 pm
Forum: Python
Topic: Old-school GUI - Possible? (Beware, silly purpose)
Replies: 25
Views: 1146

Re: Old-school GUI - Possible? (Beware, silly purpose)

That little piece of code, creates the image and responds to keystrokes as you wanted. There (currently) is no other code. If you have Java 11 you can just run it from the command line with: java McCarty.java. If you are running Java 8 you will need to compile it and then run it. javac McCarty.java ...
by knute
Mon Aug 12, 2019 6:45 pm
Forum: Python
Topic: Old-school GUI - Possible? (Beware, silly purpose)
Replies: 25
Views: 1146

Re: Old-school GUI - Possible? (Beware, silly purpose)

Spaziba wrote:
Mon Aug 12, 2019 6:01 pm

Oh my, that is also awesome! Down and dirty for the win.
Guess it's time to learn JAVA - well at least learn enough to make this.
It was kind of fun to play with. Let me know if you want some help with it. pi at knutejohnson dot com
by knute
Sun Aug 11, 2019 3:50 pm
Forum: Python
Topic: Old-school GUI - Possible? (Beware, silly purpose)
Replies: 25
Views: 1146

Re: Old-school GUI - Possible? (Beware, silly purpose)

This is a perfect job for Java. Graphics are easy and so is the logic. This is down and dirty with no attempt to streamline. import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; public class McCarty extends JFrame { public McCarty() { setLayout(new GridBagLayout()); ...
by knute
Thu Aug 08, 2019 8:01 pm
Forum: C/C++
Topic: Clock_nanosleep issues
Replies: 4
Views: 470

Re: Clock_nanosleep issues

joan wrote:
Thu Aug 08, 2019 8:43 am
We don't need your existing code. We need the smallest program you can create which exhibits the problem. Additionally the act of preparing such a program may point you to a bug in your code.
From the wayback machine a SSCCE. http://www.sscce.org/

Thank you Andrew Thompson.
by knute
Tue Aug 06, 2019 10:42 pm
Forum: Java
Topic: Install Java7 on Raspian buster
Replies: 10
Views: 631

Re: Install Java7 on Raspian buster

When you attempt to run it under Java 8 what errors are you getting? Java 7 is so far beyond end of life that without going back to a much older version of Raspbian you probably aren't going to get it to run and then you are going to run into problems getting the old version of Raspbian to run on yo...
by knute
Sun Aug 04, 2019 5:22 pm
Forum: Troubleshooting
Topic: crontab update
Replies: 16
Views: 340

Re: crontab update

Yes I know via crontab -e and then 0 16 * * * sudo apt-get update && sudo apt-get upgrade, && sudo reboot but it doesn't work If apt-get upgrade stops and asks for input it isn't going to get any and will hang right there forever. One of the easiest ways to know that cron has done a job for you is ...
by knute
Sat Aug 03, 2019 8:04 pm
Forum: Java
Topic: Install Java7 on Raspian buster
Replies: 10
Views: 631

Re: Install Java7 on Raspian buster

tomcat 8 and 9 are available for Buster. Java 11 is the standard on Buster. Can you not run tomcat with Java 11? Java 8, 9, and 10 are also available for Buster.
by knute
Sat Aug 03, 2019 7:57 pm
Forum: Java
Topic: If else help
Replies: 16
Views: 1256

Re: If else help

Download the docs, they are very helpful. An show us your code! java.lang.String boolean equalsIgnoreCase​(String anotherString) Compares this String to another String, ignoring case considerations. String toLowerCase() Converts all of the characters in this String to lower case using the rules of t...
by knute
Thu Aug 01, 2019 5:09 pm
Forum: Beginners
Topic: Restarting after a shut down w/o pulling the power cord?
Replies: 5
Views: 208

Re: Restarting after a shut down w/o pulling the power cord?

Momentarily ground GPIO pin BCM 3.
by knute
Sun Jul 28, 2019 7:34 pm
Forum: Troubleshooting
Topic: Java code into android app
Replies: 4
Views: 114

Re: Java code into android app

Take a look at this. I haven't had time to try it but I think it is exactly what you are looking for.

https://gluonhq.com/products/mobile/javafxports/
by knute
Sat Jul 27, 2019 9:13 pm
Forum: Beginners
Topic: Microphone audio input to hdmi output
Replies: 7
Views: 199

Re: Microphone audio input to hdmi output

Well with usb microphones, I can only find either bulky expensive ones, or small ones like this: https://www.amazon.com/Tanbin-Computer-Microphone-Smallest-Recording/dp/B06XVMP7FF/ref=sr_1_5?keywords=small+usb+microphone&qid=1564154470&s=gateway&sr=8-5 I need it to be small, but these kinds ^^ seem...
by knute
Fri Jul 26, 2019 3:11 pm
Forum: Beginners
Topic: Microphone audio input to hdmi output
Replies: 7
Views: 199

Re: Microphone audio input to hdmi output

A simple USB microphone won't work?
by knute
Fri Jul 26, 2019 3:08 pm
Forum: Troubleshooting
Topic: pigpio?
Replies: 2
Views: 111

Re: pigpio?

Thanks Joan!
by knute
Thu Jul 25, 2019 10:08 pm
Forum: Troubleshooting
Topic: pigpio?
Replies: 2
Views: 111

pigpio?

Is it possible to run two programs using the pigpio libraries at the same time? I'm getting an error that leads me to think that isn't possible.

2019-07-25 17:05:21 initInitialise: Can't lock /var/run/pigpio.pid

Thanks!
by knute
Tue Jul 23, 2019 3:46 pm
Forum: Beginners
Topic: Raspberry Pi 3 Temperature sensor setup
Replies: 3
Views: 133

Re: Raspberry Pi 3 Temperature sensor setup

Go to my website and look at the first article: http://pi.585ranch.com/, it has a picture on how to wire the DHTxx parts. It also has a description of how to use the dtoverlay to get the temperature and humidity data from a DHTxx part and some simple programs to do that.
by knute
Mon Jul 22, 2019 11:24 pm
Forum: Advanced users
Topic: RaspberryPi 4: heatsink or fan
Replies: 47
Views: 14653

Re: RaspberryPi 4: heatsink or fan

I saw somebody post the other day about some small fans by Noctua so I bought a 5V version. It really keeps the temp down. Now with ambient temp 27C the Pi idles at about 40C. I ran it at 98% to 99% for 20 minutes and it was about 60C at the end. I have one of those little aluminum heat sinks on the...
by knute
Mon Jul 22, 2019 10:55 pm
Forum: Beginners
Topic: Raspberry Pi 3 Temperature sensor setup
Replies: 3
Views: 133

Re: Raspberry Pi 3 Temperature sensor setup

If you have a bare sensor you need a pull-up resister. 10k will work I'm pretty sure but the device spec is for 5.1k. If you have the sensor on a board then it already has the pull-up resistor. You don't need the board you can just connect the wires. Some heat shrink tubing is good to keep them from...
by knute
Fri Jul 19, 2019 7:02 pm
Forum: Java
Topic: If else help
Replies: 16
Views: 1256

Re: If else help

Use the Console class for console I/O. Simple example of what you said you wanted. import java.io.*; public class test { public static void main(String... args) { Console con = System.console(); if (con != null) { System.out.println("good console - enter a line of text"); String str = con.readLine()...
by knute
Wed Jul 17, 2019 8:34 pm
Forum: Java
Topic: JavaMail issue on Pi0 and 1 with openjdk-11
Replies: 3
Views: 808

Re: JavaMail issue on Pi0 and 1 with openjdk-11

To me it seems like JVM cannot offer appropriate ... well... Certificate? Does not support protocol? Something like that. Maybe OpenJDK11 has That's kind of what I thought but I'm not so sure now. I looked at that link but didn't see anything that I thought was obvious. I did however find a simple ...
by knute
Wed Jul 17, 2019 4:03 pm
Forum: Java
Topic: JavaMail issue on Pi0 and 1 with openjdk-11
Replies: 3
Views: 808

JavaMail issue on Pi0 and 1 with openjdk-11

I have found some sort of a problem with JavaMail and openjdk-11 on a Pi0 or 1. To run Java 11 on a Pi0 or 1 you have to include the -zero command line option since openjdk-11 java won't run on a Pi0 or 1. The fix is to install the package openjdk-11-jre-zero which will run on a Pi0 or 1. But I'm ha...
by knute
Wed Jul 17, 2019 3:53 pm
Forum: Java
Topic: java is not supported any more on Pi0 with OS buster
Replies: 7
Views: 1757

Re: java is not supported any more on Pi0 with OS buster

So there is an interesting fault when openjdk-11 is installed on a Pi0 or Pi1. The script that sets the ca-certificates doesn't run because it call java without the -zero option and fails. This causes it to fail doing some things that require use of the certificate (eg. java.mail). Today I'm going ...

Go to advanced search